-
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 #3 from IlyasMoutawwakil/refoctor+syncio
refacored + syncio
- Loading branch information
Showing
17 changed files
with
417 additions
and
505 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: quality | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check_quality: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install quality requirements | ||
run: | | ||
pip install --upgrade pip | ||
pip install -e .[quality] | ||
- name: Check quality | ||
run: | | ||
make quality |
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ on: | |
types: [created] | ||
|
||
jobs: | ||
deploy: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
|
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 |
---|---|---|
|
@@ -10,7 +10,7 @@ style: | |
ruff check --fix . | ||
|
||
test: | ||
python tests/test.py | ||
pytest tests/ -x | ||
|
||
install: | ||
pip install -e . |
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,20 +1,12 @@ | ||
from py_tgi import TEI, TGI, is_nvidia_system, is_rocm_system | ||
|
||
if is_nvidia_system(): | ||
llm = TGI(model="NousResearch/Llama-2-7b-hf", gpus="all", port=1234) | ||
elif is_rocm_system(): | ||
llm = TGI(model="NousResearch/Llama-2-7b-hf", devices=["/dev/kfd", "/dev/dri"], port=1234) | ||
else: | ||
llm = TGI(model="NousResearch/Llama-2-7b-hf", port=1234) | ||
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?"]) | ||
print("Embed:", output) | ||
embed.close() | ||
|
||
llm = TGI(config=TGIConfig(sharded="false")) | ||
output = llm.generate(["Hi, I'm a language model", "I'm fine, how are you?"]) | ||
print("LLM:", output) | ||
|
||
if is_nvidia_system(): | ||
embed = TEI(model="BAAI/bge-large-en-v1.5", dtype="float16", pooling="mean", gpus="all", port=4321) | ||
else: | ||
embed = TEI(model="BAAI/bge-large-en-v1.5", dtype="float16", pooling="mean", port=4321) | ||
|
||
output = embed.encode(["Hi, I'm an embedding model", "I'm fine, how are you?"]) | ||
print("Embed:", output) | ||
llm.close() |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.