Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ def respond(message, history):
|
|
20 |
reply = response[0]['generated_text']
|
21 |
|
22 |
# 返回新的消息格式
|
23 |
-
return [{"role": "user", "content": message}, {"role": "assistant", "content": reply}]
|
24 |
|
25 |
# 設定 Gradio 的聊天界面
|
26 |
demo = gr.ChatInterface(fn=respond, title="Chat with Qwen 2.5", description="與 HelloSun/Qwen2.5-0.5B-Instruct-openvino 聊天!", type='messages')
|
|
|
20 |
reply = response[0]['generated_text']
|
21 |
|
22 |
# 返回新的消息格式
|
23 |
+
return [{"role": "user", "content": message}, {"role": "assistant", "content": reply}], history + [{"role": "user", "content": message}, {"role": "assistant", "content": reply}]
|
24 |
|
25 |
# 設定 Gradio 的聊天界面
|
26 |
demo = gr.ChatInterface(fn=respond, title="Chat with Qwen 2.5", description="與 HelloSun/Qwen2.5-0.5B-Instruct-openvino 聊天!", type='messages')
|