-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #254 from stochasticai/dev
release 0.1.8
Showing
9 changed files
with
192 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.1.7" | ||
__version__ = "0.1.8" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import tempfile | ||
from pathlib import Path | ||
|
||
from xturing.models import ( | ||
GenericInt8Model, | ||
GenericLoraInt8Model, | ||
GenericLoraKbitModel, | ||
GenericLoraModel, | ||
GenericModel, | ||
) | ||
|
||
|
||
def test_generic_model(): | ||
saving_path = Path(tempfile.gettempdir()) / "test_xturing_generic" | ||
model = GenericModel("distilgpt2") | ||
model.save(str(saving_path)) | ||
|
||
model2 = GenericModel(str(saving_path)) | ||
model2.generate(texts=["Why are the LLM so important?"]) | ||
|
||
|
||
def test_generic_model_int8(): | ||
saving_path = Path(tempfile.gettempdir()) / "test_xturing_generic_int8" | ||
model = GenericInt8Model("distilgpt2") | ||
model.save(str(saving_path)) | ||
|
||
model2 = GenericInt8Model(str(saving_path)) | ||
model2.generate(texts=["Why are the LLM so important?"]) | ||
|
||
|
||
def test_generic_model_lora(): | ||
saving_path = Path(tempfile.gettempdir()) / "test_xturing_generic_lora" | ||
model = GenericLoraModel("distilgpt2") | ||
model.save(str(saving_path)) | ||
|
||
model2 = GenericLoraModel(str(saving_path)) | ||
model2.generate(texts=["Why are the LLM so important?"]) | ||
|
||
|
||
def test_generic_model_int8_lora(): | ||
saving_path = Path(tempfile.gettempdir()) / "test_xturing_lora_int8" | ||
model = GenericLoraInt8Model("distilgpt2") | ||
model.save(str(saving_path)) | ||
|
||
model2 = GenericLoraInt8Model(str(saving_path)) | ||
model2.generate(texts=["Why are the LLM so important?"]) | ||
|
||
|
||
def test_generic_model_lora_kbit(): | ||
saving_path = Path(tempfile.gettempdir()) / "test_xturing_lora_kbit" | ||
model = GenericLoraKbitModel("distilgpt2") | ||
model.save(str(saving_path)) | ||
|
||
model2 = GenericLoraKbitModel(str(saving_path)) | ||
model2.generate(texts=["Why are the LLM so important?"]) |