orrinin commited on
Commit
a8e4de0
·
verified ·
1 Parent(s): e74517c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -113,7 +113,7 @@ with gr.Blocks(css=css, title="家庭医生AI助手") as iface:
113
  submit_btn = gr.Button("🚀 确认") # Create a submit button
114
  clear_btn = gr.ClearButton([output_box,image_input,text_input], value="🗑️ 清空") # Create a clear button
115
 
116
- def update(json_path: str):
117
  if json_path:
118
  job = client.submit(
119
  json_path,
@@ -127,7 +127,7 @@ with gr.Blocks(css=css, title="家庭医生AI助手") as iface:
127
  else:
128
  return
129
  # Set up the event listeners
130
- submit_btn.click(main, inputs=[text_input, image_input, unit], outputs=output_box).success(update(json_path))
131
  gr.Markdown(LICENSE)
132
 
133
  #gr.close_all()
 
113
  submit_btn = gr.Button("🚀 确认") # Create a submit button
114
  clear_btn = gr.ClearButton([output_box,image_input,text_input], value="🗑️ 清空") # Create a clear button
115
 
116
+ def update():
117
  if json_path:
118
  job = client.submit(
119
  json_path,
 
127
  else:
128
  return
129
  # Set up the event listeners
130
+ submit_btn.click(main, inputs=[text_input, image_input, unit], outputs=output_box).then(update)
131
  gr.Markdown(LICENSE)
132
 
133
  #gr.close_all()