xulh commited on
Commit
bb1d3e2
·
1 Parent(s): 69d5d0e

代码初始化

Browse files
Files changed (1) hide show
  1. inference/inference.py +6 -0
inference/inference.py CHANGED
@@ -33,6 +33,12 @@ async def chat_completion(token: str = Body(...), messages: list = Body(...)):
33
  # 创建 InferenceClient
34
  client = InferenceClient(api_key=token)
35
 
 
 
 
 
 
 
36
  # 使用 chat API 请求生成模型的回答
37
  completion = client.chat.completions.create(
38
  model="meta-llama/Llama-3.1-8B-Instruct",
 
33
  # 创建 InferenceClient
34
  client = InferenceClient(api_key=token)
35
 
36
+ messages.append({
37
+ "role": "system",
38
+ "content": "You are a multilingual chatbot capable of understanding questions in various languages and "
39
+ "providing accurate responses in the appropriate language."
40
+ })
41
+
42
  # 使用 chat API 请求生成模型的回答
43
  completion = client.chat.completions.create(
44
  model="meta-llama/Llama-3.1-8B-Instruct",