Artin2009 commited on
Commit
23fb931
·
verified ·
1 Parent(s): 07dbb4c

Update chain_app.py

Browse files
Files changed (1) hide show
  1. chain_app.py +7 -7
chain_app.py CHANGED
@@ -2529,14 +2529,14 @@ async def main(message: cl.Message):
2529
  "mistralai/Mistral-7B-Instruct-v0.2",
2530
  token=f"{hf_token_llama_3_1}",
2531
  )
2532
- complete_message = ""
2533
- for message in client.chat_completion(
2534
- messages=[{"role": "user", "content": message.content}],
2535
  max_tokens=500,
2536
- stream=False,
2537
- ):
2538
- complete_message += message.choices[0].delta.content
2539
- await cl.Message(content=complete_message).send()
 
2540
 
2541
 
2542
 
 
2529
  "mistralai/Mistral-7B-Instruct-v0.2",
2530
  token=f"{hf_token_llama_3_1}",
2531
  )
2532
+ result = client.chat_completion(
2533
+ messages=[{"role": "user", "content": "What is the capital of France?"}],
 
2534
  max_tokens=500,
2535
+ )
2536
+
2537
+ await cl.Message(
2538
+ content=result.choices[0].message.content,
2539
+ ).send()
2540
 
2541
 
2542