Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import os
|
|
4 |
|
5 |
# 初始化 Hugging Face 客户端
|
6 |
client = InferenceClient(
|
7 |
-
provider="
|
8 |
api_key = os.getenv("HF_token")
|
9 |
)
|
10 |
|
@@ -28,15 +28,14 @@ def chat(user_input, history, cot_enabled):
|
|
28 |
|
29 |
try:
|
30 |
completion = client.chat.completions.create(
|
31 |
-
model="deepseek-ai/DeepSeek-R1-Distill-
|
32 |
messages=messages,
|
33 |
-
max_tokens=
|
34 |
-
temperature=0.
|
35 |
)
|
36 |
|
37 |
reply = completion.choices[0].message.content
|
38 |
|
39 |
-
# 返回 OpenAI 样式消息格式
|
40 |
history.append({"role": "user", "content": user_input})
|
41 |
history.append({"role": "assistant", "content": reply})
|
42 |
return history, history
|
|
|
4 |
|
5 |
# 初始化 Hugging Face 客户端
|
6 |
client = InferenceClient(
|
7 |
+
provider="novita",
|
8 |
api_key = os.getenv("HF_token")
|
9 |
)
|
10 |
|
|
|
28 |
|
29 |
try:
|
30 |
completion = client.chat.completions.create(
|
31 |
+
model="deepseek-ai/DeepSeek-R1-Distill-Llama-8B",
|
32 |
messages=messages,
|
33 |
+
max_tokens=512,
|
34 |
+
temperature=0.5,
|
35 |
)
|
36 |
|
37 |
reply = completion.choices[0].message.content
|
38 |
|
|
|
39 |
history.append({"role": "user", "content": user_input})
|
40 |
history.append({"role": "assistant", "content": reply})
|
41 |
return history, history
|