Skip to content

Commit

Permalink
Merge pull request #13 from IlyasMoutawwakil/update-version
Browse files Browse the repository at this point in the history
update version
  • Loading branch information
IlyasMoutawwakil authored Sep 4, 2024
2 parents f114db7 + 5b9beb4 commit a92a692
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install requirements
- name: Install release requirements
run: |
pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
- name: Build and publish release
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand Down
21 changes: 11 additions & 10 deletions example.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
from py_txi.text_embedding_inference import TEI, TEIConfig
from py_txi.text_generation_inference import TGI, TGIConfig

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("LLM:", output)
llm.close()
for gpus in [None, "1", "1,2"]:
llm = TGI(config=TGIConfig(model_id="bigscience/bloom-560m", gpus=gpus))
output = llm.generate(["Hi, I'm a language model", "I'm fine, how are you?"])
print(len(output))
print("LLM:", output)
llm.close()

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("Embed:", output)
embed.close()
embed = TEI(config=TEIConfig(model_id="BAAI/bge-base-en-v1.5", gpus=gpus))
output = embed.encode(["Hi, I'm an embedding model", "I'm fine, how are you?"])
print(len(output))
print("Embed:", output)
embed.close()
6 changes: 3 additions & 3 deletions py_txi/text_embedding_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ def __post_init__(self) -> None:

if self.image is None:
if is_nvidia_system() and self.gpus is not None:
LOGGER.info("\t+ Using the latest NVIDIA GPU image for Text-Embedding-Inference")
self.image = "ghcr.io/huggingface/text-embeddings-inference:latest"
LOGGER.info("\t+ Using latest NVIDIA CUDA GPU image for Text-Embedding-Inference")
self.image = "ghcr.io/huggingface/text-embeddings-inference:cuda-latest"
else:
LOGGER.info("\t+ Using version 1.4 image for Text-Embedding-Inference")
LOGGER.info("\t+ Using CPU image version 1.4 for Text-Embedding-Inference (before onnx backend)")
self.image = "ghcr.io/huggingface/text-embeddings-inference:cpu-1.4"

if is_nvidia_system() and "cpu" in self.image:
Expand Down
8 changes: 4 additions & 4 deletions py_txi/text_generation_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ def __post_init__(self) -> None:

if self.image is None:
if is_nvidia_system() and self.gpus is not None:
LOGGER.info("\t+ Using latest NVIDIA GPU image for Text-Generation-Inference")
LOGGER.info("\t+ Using latest NVIDIA CUDA GPU image for Text-Generation-Inference")
self.image = "ghcr.io/huggingface/text-generation-inference:latest"
elif is_rocm_system() and self.devices is not None:
LOGGER.info("\t+ Using latest ROCm AMD GPU image for Text-Generation-Inference")
LOGGER.info("\t+ Using latest AMD ROCm GPU image for Text-Generation-Inference")
self.image = "ghcr.io/huggingface/text-generation-inference:latest-rocm"
else:
LOGGER.info("\t+ Using version 1.4 image for Text-Generation-Inference (last image with CPU support)")
self.image = "ghcr.io/huggingface/text-generation-inference:1.4"
LOGGER.info("\t+ Using latest image for Text-Generation-Inference")
self.image = "ghcr.io/huggingface/text-generation-inference:latest"

if is_rocm_system() and "rocm" not in self.image:
LOGGER.warning("\t+ You are running on a ROCm AMD GPU system but using a non-ROCM image.")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from setuptools import find_packages, setup

PY_TXI_VERSION = "0.9.0"
PY_TXI_VERSION = "0.10.0"

common_setup_kwargs = {
"author": "Ilyas Moutawwakil",
Expand Down

0 comments on commit a92a692

Please sign in to comment.