3v324v23 commited on
Commit
730cd1e
2 Parent(s): c78254c 4b21ebd

Merge branch 'master' of https://github.com/Okabe-Rintarou-0/chatgpt_academic into Okabe-Rintarou-0-master

Browse files
Files changed (1) hide show
  1. main.py +1 -0
main.py CHANGED
@@ -84,6 +84,7 @@ with gr.Blocks(theme=set_theme, analytics_enabled=False) as demo:
84
  can_cancel_events.append(submitBtn.click(**predict_args))
85
  submitBtn.click(**empty_txt_args)
86
  resetBtn.click(lambda: ([], [], "已重置"), None, [chatbot, history, statusDisplay])
 
87
  for k in functional:
88
  click_handle = functional[k]["Button"].click(predict,
89
  [txt, top_p, temperature, chatbot, history, system_prompt, gr.State(True), gr.State(k)], [chatbot, history, statusDisplay], show_progress=True)
 
84
  can_cancel_events.append(submitBtn.click(**predict_args))
85
  submitBtn.click(**empty_txt_args)
86
  resetBtn.click(lambda: ([], [], "已重置"), None, [chatbot, history, statusDisplay])
87
+ stopBtn.click(fn=None, inputs=None, outputs=None, cancels=[submit_event])
88
  for k in functional:
89
  click_handle = functional[k]["Button"].click(predict,
90
  [txt, top_p, temperature, chatbot, history, system_prompt, gr.State(True), gr.State(k)], [chatbot, history, statusDisplay], show_progress=True)