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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -114,19 +114,18 @@ with gr.Blocks(css=css, title="家庭医生AI助手") as iface:
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,
120
- fn_index=1
121
- )
122
- if job.done():
123
  response = job.result(timeout=60)
124
  with open(response, 'r') as f:
125
  data = json.load(f)
126
- print(data)
127
- result = data[-1][1]
128
- else:
129
- return
130
  # Set up the event listeners
131
  submit_btn.click(main, inputs=[text_input, image_input, unit], outputs=output_box).success(update(json_path))
132
  gr.Markdown(LICENSE)
 
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,
120
+ fn_index=1
121
+ )
 
122
  response = job.result(timeout=60)
123
  with open(response, 'r') as f:
124
  data = json.load(f)
125
+ print(data)
126
+ result = data[-1][1]
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)