Spaces:
Sleeping
Sleeping
changed model
Browse files
app.py
CHANGED
|
@@ -7,7 +7,25 @@ from huggingface_hub import InferenceClient
|
|
| 7 |
"""
|
| 8 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
| 9 |
"""
|
| 10 |
-
client = InferenceClient("google/gemma-3-27b-it", token=os.getenv("TOKEN"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
global history
|
| 13 |
history = []
|
|
@@ -31,8 +49,10 @@ async def respond(
|
|
| 31 |
|
| 32 |
response = ""
|
| 33 |
|
| 34 |
-
for message in client.chat_completion(
|
| 35 |
-
|
|
|
|
|
|
|
| 36 |
max_tokens=max_tokens,
|
| 37 |
stream=True,
|
| 38 |
temperature=temperature,
|
|
|
|
| 7 |
"""
|
| 8 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
| 9 |
"""
|
| 10 |
+
#client = InferenceClient("google/gemma-3-27b-it", token=os.getenv("TOKEN"))
|
| 11 |
+
|
| 12 |
+
client = InferenceClient(
|
| 13 |
+
provider="fireworks-ai",
|
| 14 |
+
api_key=os.getenv("TOKEN"),
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
# completion = client.chat.completions.create(
|
| 18 |
+
# model="deepseek-ai/DeepSeek-V3-0324",
|
| 19 |
+
# messages=[
|
| 20 |
+
# {
|
| 21 |
+
# "role": "user",
|
| 22 |
+
# "content": "What is the capital of France?"
|
| 23 |
+
# }
|
| 24 |
+
# ],
|
| 25 |
+
# max_tokens=500,
|
| 26 |
+
# )
|
| 27 |
+
|
| 28 |
+
# print(completion.choices[0].message)
|
| 29 |
|
| 30 |
global history
|
| 31 |
history = []
|
|
|
|
| 49 |
|
| 50 |
response = ""
|
| 51 |
|
| 52 |
+
#for message in client.chat_completion(
|
| 53 |
+
for message in client.chat.completions.create(
|
| 54 |
+
model="deepseek-ai/DeepSeek-V3-0324",
|
| 55 |
+
messages=messages,
|
| 56 |
max_tokens=max_tokens,
|
| 57 |
stream=True,
|
| 58 |
temperature=temperature,
|