Update app.py
Browse files
app.py
CHANGED
@@ -41,7 +41,8 @@ def respond(prompt, history):
|
|
41 |
|
42 |
print(f"Messages: {messages}")
|
43 |
print(f"Reply: {response}")
|
44 |
-
|
|
|
45 |
# 更新並返回完整的聊天歷史(改為字典列表)
|
46 |
new_history = history.copy()
|
47 |
new_history.append({"user": prompt, "assistant": response})
|
@@ -52,6 +53,7 @@ def respond(prompt, history):
|
|
52 |
final_messages.append({"role": "user", "content": item["user"]})
|
53 |
final_messages.append({"role": "assistant", "content": item["assistant"]})
|
54 |
return final_messages
|
|
|
55 |
|
56 |
# 設定 Gradio 的聊天界面
|
57 |
demo = gr.ChatInterface(
|
|
|
41 |
|
42 |
print(f"Messages: {messages}")
|
43 |
print(f"Reply: {response}")
|
44 |
+
return response
|
45 |
+
'''''
|
46 |
# 更新並返回完整的聊天歷史(改為字典列表)
|
47 |
new_history = history.copy()
|
48 |
new_history.append({"user": prompt, "assistant": response})
|
|
|
53 |
final_messages.append({"role": "user", "content": item["user"]})
|
54 |
final_messages.append({"role": "assistant", "content": item["assistant"]})
|
55 |
return final_messages
|
56 |
+
'''''
|
57 |
|
58 |
# 設定 Gradio 的聊天界面
|
59 |
demo = gr.ChatInterface(
|