Spaces:
Runtime error
Runtime error
Update bin_public/app/Chatbot.py
Browse files- bin_public/app/Chatbot.py +28 -3
bin_public/app/Chatbot.py
CHANGED
|
@@ -90,7 +90,8 @@ with gr.Blocks(css=customCSS) as demo:
|
|
| 90 |
with gr.Column(min_width=50, scale=1):
|
| 91 |
submitBtn = gr.Button("🚀", variant="primary")
|
| 92 |
cancelBtn = gr.Button("取消", variant="secondary", visible=False)
|
| 93 |
-
finalBtn = gr.Button("
|
|
|
|
| 94 |
with gr.Row(scale=1):
|
| 95 |
emptyBtn = gr.Button("🧹 新的对话", visible=False)
|
| 96 |
retryBtn = gr.Button("🔄 重新生成", visible=False)
|
|
@@ -310,7 +311,7 @@ with gr.Blocks(css=customCSS) as demo:
|
|
| 310 |
''' =============================================================================================='''
|
| 311 |
# 角色
|
| 312 |
|
| 313 |
-
finalBtn.click(predict, [
|
| 314 |
keyTxt,
|
| 315 |
invite_code,
|
| 316 |
gr.Textbox('不管我说了什么,你只需要回复:“好的谢谢医生”', visible=False),
|
|
@@ -324,10 +325,34 @@ with gr.Blocks(css=customCSS) as demo:
|
|
| 324 |
model_select_dropdown,
|
| 325 |
use_websearch_checkbox,
|
| 326 |
index_files],
|
| 327 |
-
[chatbot, history, status_display, token_count], show_progress=True)
|
| 328 |
|
| 329 |
finalBtn.click(reset_textbox, [], [user_input])
|
| 330 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 331 |
interviewer.click(info_context, [file_list_m],
|
| 332 |
[patient_prompt], show_progress=True).then(predict, [
|
| 333 |
keyTxt,
|
|
|
|
| 90 |
with gr.Column(min_width=50, scale=1):
|
| 91 |
submitBtn = gr.Button("🚀", variant="primary")
|
| 92 |
cancelBtn = gr.Button("取消", variant="secondary", visible=False)
|
| 93 |
+
finalBtn = gr.Button("诊断结果提交", variant="primary")
|
| 94 |
+
kaiyaoBtn = gr.Button("开药结果提交", variant="primary")
|
| 95 |
with gr.Row(scale=1):
|
| 96 |
emptyBtn = gr.Button("🧹 新的对话", visible=False)
|
| 97 |
retryBtn = gr.Button("🔄 重新生成", visible=False)
|
|
|
|
| 311 |
''' =============================================================================================='''
|
| 312 |
# 角色
|
| 313 |
|
| 314 |
+
finalBtn.click(construct_zhenduan, [user_input], [user_input]).then(predict, [
|
| 315 |
keyTxt,
|
| 316 |
invite_code,
|
| 317 |
gr.Textbox('不管我说了什么,你只需要回复:“好的谢谢医生”', visible=False),
|
|
|
|
| 325 |
model_select_dropdown,
|
| 326 |
use_websearch_checkbox,
|
| 327 |
index_files],
|
| 328 |
+
[chatbot, history, status_display, token_count], show_progress=True)
|
| 329 |
|
| 330 |
finalBtn.click(reset_textbox, [], [user_input])
|
| 331 |
|
| 332 |
+
kaiyaoBtn.click(construct_kaiyao, [user_input], [user_input]).then(predict, [
|
| 333 |
+
keyTxt,
|
| 334 |
+
invite_code,
|
| 335 |
+
gr.Textbox('不管我说了什么,你只需要回复:“好的谢谢医生”', visible=False),
|
| 336 |
+
history,
|
| 337 |
+
user_input,
|
| 338 |
+
chatbot,
|
| 339 |
+
token_count,
|
| 340 |
+
top_p,
|
| 341 |
+
temperature,
|
| 342 |
+
use_streaming_checkbox,
|
| 343 |
+
model_select_dropdown,
|
| 344 |
+
use_websearch_checkbox,
|
| 345 |
+
index_files],
|
| 346 |
+
[chatbot, history, status_display, token_count],
|
| 347 |
+
show_progress=True).then(reset_state,
|
| 348 |
+
outputs=[chatbot,
|
| 349 |
+
history,
|
| 350 |
+
token_count,
|
| 351 |
+
status_display],
|
| 352 |
+
show_progress=True)
|
| 353 |
+
|
| 354 |
+
kaiyaoBtn.click(reset_textbox, [], [user_input])
|
| 355 |
+
|
| 356 |
interviewer.click(info_context, [file_list_m],
|
| 357 |
[patient_prompt], show_progress=True).then(predict, [
|
| 358 |
keyTxt,
|