-
Notifications
You must be signed in to change notification settings - Fork 6
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 #6 from IlyasMoutawwakil/update-2.0
Updates for TGI 2.0
- Loading branch information
Showing
10 changed files
with
135 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,4 @@ jobs: | |
- name: Run test | ||
run: | | ||
make test | ||
make test_cpu |
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
from py_txi.text_embedding_inference import TEI, TEIConfig | ||
from py_txi.text_generation_inference import TGI, TGIConfig | ||
|
||
embed = TEI(config=TEIConfig(pooling="cls")) | ||
output = embed.encode(["Hi, I'm an embedding model", "I'm fine, how are you?"] * 100) | ||
llm = TGI(config=TGIConfig(model_id="bigscience/bloom-560m", gpus="0")) | ||
output = llm.generate(["Hi, I'm a language model", "I'm fine, how are you?"]) | ||
print(len(output)) | ||
print("Embed:", output[0]) | ||
embed.close() | ||
print("LLM:", output) | ||
llm.close() | ||
|
||
llm = TGI(config=TGIConfig(sharded="false")) | ||
output = llm.generate(["Hi, I'm a language model", "I'm fine, how are you?"] * 50) | ||
embed = TEI(config=TEIConfig(model_id="BAAI/bge-base-en-v1.5")) | ||
output = embed.encode(["Hi, I'm an embedding model", "I'm fine, how are you?"]) | ||
print(len(output)) | ||
print("LLM:", output[0]) | ||
llm.close() | ||
# print("Embed:", output) | ||
embed.close() |
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