Spaces:
Sleeping
Sleeping
Patryk Studzinski
commited on
Commit
·
f4ce3a1
1
Parent(s):
068583f
update HuggingFaceInferenceAPI comment for clarity; change huggingface_hub version to minimum required
Browse files
app/models/huggingface_inference_api.py
CHANGED
|
@@ -85,7 +85,7 @@ class HuggingFaceInferenceAPI(BaseLLM):
|
|
| 85 |
print(f"[{self.name}] Calling Inference API with {len(messages)} messages", flush=True)
|
| 86 |
|
| 87 |
try:
|
| 88 |
-
# Use
|
| 89 |
response = await asyncio.to_thread(
|
| 90 |
self.client.chat_completion,
|
| 91 |
messages=messages,
|
|
|
|
| 85 |
print(f"[{self.name}] Calling Inference API with {len(messages)} messages", flush=True)
|
| 86 |
|
| 87 |
try:
|
| 88 |
+
# Use chat_completion method (huggingface_hub InferenceClient)
|
| 89 |
response = await asyncio.to_thread(
|
| 90 |
self.client.chat_completion,
|
| 91 |
messages=messages,
|
requirements.txt
CHANGED
|
@@ -2,7 +2,7 @@ fastapi==0.104.1
|
|
| 2 |
uvicorn[standard]==0.24.0
|
| 3 |
transformers==4.36.2
|
| 4 |
accelerate==0.25.0
|
| 5 |
-
huggingface_hub
|
| 6 |
pydantic==2.5.0
|
| 7 |
importlib-metadata
|
| 8 |
--extra-index-url https://download.pytorch.org/whl/cpu
|
|
|
|
| 2 |
uvicorn[standard]==0.24.0
|
| 3 |
transformers==4.36.2
|
| 4 |
accelerate==0.25.0
|
| 5 |
+
huggingface_hub>=0.26.0
|
| 6 |
pydantic==2.5.0
|
| 7 |
importlib-metadata
|
| 8 |
--extra-index-url https://download.pytorch.org/whl/cpu
|