Rioo26 commited on
Commit
53c4869
·
verified ·
1 Parent(s): 4964e61

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -4,7 +4,7 @@ import os
4
 
5
  # 初始化 Hugging Face 客户端
6
  client = InferenceClient(
7
- provider="hf-inference",
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-Qwen-1.5B",
32
  messages=messages,
33
- max_tokens=1000,
34
- temperature=0.3,
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