Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -66,12 +66,17 @@ def clear_history():
|
|
66 |
return [], []
|
67 |
|
68 |
# 多轮界面
|
69 |
-
|
70 |
-
|
71 |
-
[
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
)
|
|
|
|
|
|
|
|
|
|
|
76 |
|
77 |
-
multi_turn_interface.
|
|
|
66 |
return [], []
|
67 |
|
68 |
# 多轮界面
|
69 |
+
with gr.Blocks() as multi_turn_interface:
|
70 |
+
chatbot = gr.Chatbot(label="仲景GPT-V2-1.8B 多轮对话")
|
71 |
+
state = gr.State([])
|
72 |
+
with gr.Row():
|
73 |
+
with gr.Column(scale=6):
|
74 |
+
user_input = gr.Textbox(label="输入",placeholder="输入你的问题")
|
75 |
+
with gr.Column(scale=1):
|
76 |
+
submit_btn = gr.Button("提交")
|
77 |
+
clear_history_btn = gr.Button("清除历史对话")
|
78 |
+
submit_btn.click(multi_turn_chat, [user_input, state], [chatbot, state], concurrency_limit=10)
|
79 |
+
clear_history_btn.click(fn=clear_history, inputs=None, outputs=[chatbot, state], queue=False)
|
80 |
+
user_input.submit(multi_turn_chat, [user_input, state], [chatbot, state], concurrency_limit=10)
|
81 |
|
82 |
+
multi_turn_interface.launch(debug=True, server_name='0.0.0.0', server_port=6006, max_threads=200)
|