xulh commited on
Commit
b30a245
·
1 Parent(s): 3ae1a20

代码初始化

Browse files
Files changed (1) hide show
  1. inference/inference.py +4 -0
inference/inference.py CHANGED
@@ -64,6 +64,10 @@ async def chat_completion(token: str = Body(...), messages: list = Body(...)):
64
  "content": "You are a multilingual chatbot capable of understanding questions in various languages and "
65
  "providing accurate responses in the appropriate language."
66
  })
 
 
 
 
67
 
68
  # 使用 chat API 请求生成模型的回答
69
  completion = client.chat.completions.create(
 
64
  "content": "You are a multilingual chatbot capable of understanding questions in various languages and "
65
  "providing accurate responses in the appropriate language."
66
  })
67
+ messages.append({
68
+ "role": "system",
69
+ "content": "所有问题都用中文回答"
70
+ })
71
 
72
  # 使用 chat API 请求生成模型的回答
73
  completion = client.chat.completions.create(