Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for python version 3.10 #194

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dependencies = [
"accelerate==0.34.2",
"hf-transfer==0.1.8",
"cachetools~=5.5",
"strenum==0.4.15; python_version<'3.11'",
# additional dependencies for OpenTelemetry tracing
"opentelemetry-sdk>=1.26.0,<1.28.0",
"opentelemetry-api>=1.26.0,<1.28.0",
Expand Down
8 changes: 3 additions & 5 deletions src/vllm_tgis_adapter/grpc/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,10 @@ def _load_adapter_metadata(adapter_id: str, adapter_path: str, unique_id: int) -
if (Path(adapter_path) / "decoder.pt").exists():
# Create new temporary directory and convert to peft format there
# NB: This requires write access to /tmp
# Intentionally setting delete=False, we need the new adapter
# files to exist for the life of the process
logger.info("Converting caikit-style adapter %s to peft format", adapter_id)
temp_dir = tempfile.TemporaryDirectory(delete=False)
convert_pt_to_peft(adapter_path, temp_dir.name)
adapter_path = temp_dir.name
temp_dir = tempfile.mkdtemp()
convert_pt_to_peft(adapter_path, temp_dir)
adapter_path = temp_dir

adapter_config_path = Path(adapter_path) / "adapter_config.json"
if not Path(adapter_config_path).exists():
Expand Down
8 changes: 7 additions & 1 deletion src/vllm_tgis_adapter/tgis_utils/metrics.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
"""Implements the logging for all tgi_* metrics for compatibility with TGIS opsviz."""

import time
from enum import StrEnum, auto
try:
# StrEnum is available in the standard library `enum` from Python 3.11 onwards
from enum import StrEnum, auto
except:
# For Python versions < 3.11, StrEnum is not available in the standard library `enum`
from enum import auto
from strenum import StrEnum

from prometheus_client import Counter, Gauge, Histogram
from vllm import RequestOutput
Expand Down