SiangKai commited on
Commit
275bc55
·
verified ·
1 Parent(s): fb20aa6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -14
app.py CHANGED
@@ -655,7 +655,6 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue", secondary_hue="orange"),
655
  with gr.Row():
656
  btn_clear = gr.ClearButton(value="清除")
657
  btn_submit = gr.Button("送出查詢", variant="primary")
658
- btn_stop = gr.Button("中止", variant="stop")
659
 
660
  with gr.Column(scale=1):
661
  output_analysis = gr.Textbox(
@@ -683,19 +682,8 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue", secondary_hue="orange"),
683
 
684
  # --- 事件綁定 ---
685
  outputs_list = [output_analysis, output_result]
686
- # btn_submit.click(fn=gradio_interface, inputs=user_input_box, outputs=outputs_list)
687
- # user_input_box.submit(fn=gradio_interface, inputs=user_input_box, outputs=outputs_list)
688
-
689
- submit_event = btn_submit.click(fn=gradio_interface, inputs=user_input_box, outputs=outputs_list)
690
- textbox_submit_event = user_input_box.submit(fn=gradio_interface, inputs=user_input_box, outputs=outputs_list)
691
-
692
- btn_stop.click(
693
- fn=None,
694
- inputs=None,
695
- outputs=None,
696
- cancels=[submit_event, textbox_submit_event]
697
- )
698
-
699
  btn_clear.add([user_input_box] + outputs_list)
700
 
701
  # --- 啟動應用程式 ---
 
655
  with gr.Row():
656
  btn_clear = gr.ClearButton(value="清除")
657
  btn_submit = gr.Button("送出查詢", variant="primary")
 
658
 
659
  with gr.Column(scale=1):
660
  output_analysis = gr.Textbox(
 
682
 
683
  # --- 事件綁定 ---
684
  outputs_list = [output_analysis, output_result]
685
+ btn_submit.click(fn=gradio_interface, inputs=user_input_box, outputs=outputs_list)
686
+ user_input_box.submit(fn=gradio_interface, inputs=user_input_box, outputs=outputs_list)
 
 
 
 
 
 
 
 
 
 
 
687
  btn_clear.add([user_input_box] + outputs_list)
688
 
689
  # --- 啟動應用程式 ---