Update app.py
Browse files
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 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
if job.done():
|
123 |
response = job.result(timeout=60)
|
124 |
with open(response, 'r') as f:
|
125 |
data = json.load(f)
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
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)
|