orrinin commited on
Commit
2780ed6
·
verified ·
1 Parent(s): b0b45b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -107,7 +107,7 @@ def output():
107
  def refresh():
108
  global result
109
  time.sleep(20)
110
- return gr.Markdown(value=result, label="分析")
111
 
112
  def reset_result():
113
  global result
@@ -128,7 +128,7 @@ with gr.Blocks(css=css, title="家庭医生AI助手", theme="soft") as iface:
128
  "整形美容科", "营养科", "生殖中心", "麻醉医学科", "医学影像科", \
129
  "骨科", "肿瘤科", "急诊科", "检验科"])
130
  with gr.Row():
131
- output_box = output()
132
  with gr.Row():
133
  image_input = gr.Image(type="filepath", label="上传图片") # Create an image upload button
134
  text_input = gr.Textbox(label="输入") # Create a text input box
@@ -140,7 +140,7 @@ with gr.Blocks(css=css, title="家庭医生AI助手", theme="soft") as iface:
140
 
141
  # Set up the event listeners
142
  submit_btn.click(main, inputs=[text_input, image_input, unit], outputs=output_box)
143
- output_box.change(fn=refresh)
144
 
145
 
146
 
 
107
  def refresh():
108
  global result
109
  time.sleep(20)
110
+ return result
111
 
112
  def reset_result():
113
  global result
 
128
  "整形美容科", "营养科", "生殖中心", "麻醉医学科", "医学影像科", \
129
  "骨科", "肿瘤科", "急诊科", "检验科"])
130
  with gr.Row():
131
+ output_box = gr.Markdown(label="分析")
132
  with gr.Row():
133
  image_input = gr.Image(type="filepath", label="上传图片") # Create an image upload button
134
  text_input = gr.Textbox(label="输入") # Create a text input box
 
140
 
141
  # Set up the event listeners
142
  submit_btn.click(main, inputs=[text_input, image_input, unit], outputs=output_box)
143
+ output_box.change(fn=refresh, outputs=output_box)
144
 
145
 
146