Update app.py
Browse files
app.py
CHANGED
|
@@ -102,13 +102,12 @@ def process_image(image_input, unit):
|
|
| 102 |
return "正在分析..."
|
| 103 |
|
| 104 |
def output():
|
| 105 |
-
global result
|
| 106 |
-
print(result)
|
| 107 |
return gr.Markdown(value=result, label="分析")
|
| 108 |
|
| 109 |
def refresh():
|
| 110 |
-
|
| 111 |
-
|
|
|
|
| 112 |
|
| 113 |
def reset_result():
|
| 114 |
global result
|
|
@@ -140,7 +139,8 @@ with gr.Blocks(css=css, title="家庭医生AI助手", theme="soft") as iface:
|
|
| 140 |
gr.Markdown(LICENSE)
|
| 141 |
|
| 142 |
# Set up the event listeners
|
| 143 |
-
submit_btn.click(main, inputs=[text_input, image_input, unit], outputs=output_box)
|
|
|
|
| 144 |
|
| 145 |
|
| 146 |
|
|
|
|
| 102 |
return "正在分析..."
|
| 103 |
|
| 104 |
def output():
|
|
|
|
|
|
|
| 105 |
return gr.Markdown(value=result, label="分析")
|
| 106 |
|
| 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
|
|
|
|
| 139 |
gr.Markdown(LICENSE)
|
| 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 |
|