orrinin commited on
Commit
2e43bd8
·
verified ·
1 Parent(s): 88d69c2

Update app.py

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