Update app.py
Browse files
app.py
CHANGED
@@ -101,9 +101,9 @@ def process_image(image_input, unit):
|
|
101 |
|
102 |
return "等待分析..."
|
103 |
|
104 |
-
def
|
105 |
-
global result
|
106 |
return result
|
|
|
107 |
def reset_result():
|
108 |
global result
|
109 |
result = 0
|
@@ -123,7 +123,7 @@ with gr.Blocks(css=css, title="家庭医生AI助手") as iface:
|
|
123 |
"整形美容科", "营养科", "生殖中心", "麻醉医学科", "医学影像科", \
|
124 |
"骨科", "肿瘤科", "急诊科", "检验科"])
|
125 |
with gr.Row():
|
126 |
-
output_box = gr.Markdown(value=result,
|
127 |
with gr.Row():
|
128 |
image_input = gr.Image(type="filepath", label="上传图片") # Create an image upload button
|
129 |
text_input = gr.Textbox(label="输入") # Create a text input box
|
@@ -135,7 +135,8 @@ with gr.Blocks(css=css, title="家庭医生AI助手") as iface:
|
|
135 |
|
136 |
# Set up the event listeners
|
137 |
submit_btn.click(main, inputs=[text_input, image_input, unit], outputs=output_box)
|
138 |
-
|
|
|
139 |
|
140 |
#gr.close_all()
|
141 |
|
|
|
101 |
|
102 |
return "等待分析..."
|
103 |
|
104 |
+
def refresh():
|
|
|
105 |
return result
|
106 |
+
|
107 |
def reset_result():
|
108 |
global result
|
109 |
result = 0
|
|
|
123 |
"整形美容科", "营养科", "生殖中心", "麻醉医学科", "医学影像科", \
|
124 |
"骨科", "肿瘤科", "急诊科", "检验科"])
|
125 |
with gr.Row():
|
126 |
+
output_box = gr.Markdown(value=result, label="分析")
|
127 |
with gr.Row():
|
128 |
image_input = gr.Image(type="filepath", label="上传图片") # Create an image upload button
|
129 |
text_input = gr.Textbox(label="输入") # Create a text input box
|
|
|
135 |
|
136 |
# Set up the event listeners
|
137 |
submit_btn.click(main, inputs=[text_input, image_input, unit], outputs=output_box)
|
138 |
+
submit_btn.click(refresh, every= 1000, outputs=output_box)
|
139 |
+
|
140 |
|
141 |
#gr.close_all()
|
142 |
|