Update app.py
Browse files
app.py
CHANGED
@@ -44,6 +44,7 @@ result = "等待分析..."
|
|
44 |
json_path = ""
|
45 |
|
46 |
def process_text(text_input, unit):
|
|
|
47 |
client = Client(client_chat)
|
48 |
print(client.view_api())
|
49 |
job = client.submit(
|
@@ -100,6 +101,7 @@ def process_image(image_input, unit):
|
|
100 |
return "等待分析..."
|
101 |
|
102 |
def fetch_result():
|
|
|
103 |
return result
|
104 |
|
105 |
|
@@ -118,7 +120,7 @@ with gr.Blocks(css=css, title="家庭医生AI助手") as iface:
|
|
118 |
"整形美容科", "营养科", "生殖中心", "麻醉医学科", "医学影像科", \
|
119 |
"骨科", "肿瘤科", "急诊科", "检验科"])
|
120 |
with gr.Row():
|
121 |
-
output_box = gr.Markdown(value=result, every=10, label="分析"
|
122 |
with gr.Row():
|
123 |
image_input = gr.Image(type="filepath", label="上传图片") # Create an image upload button
|
124 |
text_input = gr.Textbox(label="输入") # Create a text input box
|
|
|
44 |
json_path = ""
|
45 |
|
46 |
def process_text(text_input, unit):
|
47 |
+
global result
|
48 |
client = Client(client_chat)
|
49 |
print(client.view_api())
|
50 |
job = client.submit(
|
|
|
101 |
return "等待分析..."
|
102 |
|
103 |
def fetch_result():
|
104 |
+
global result
|
105 |
return result
|
106 |
|
107 |
|
|
|
120 |
"整形美容科", "营养科", "生殖中心", "麻醉医学科", "医学影像科", \
|
121 |
"骨科", "肿瘤科", "急诊科", "检验科"])
|
122 |
with gr.Row():
|
123 |
+
output_box = gr.Markdown(value=result, every=10, label="分析").change(fn=fetch_result)
|
124 |
with gr.Row():
|
125 |
image_input = gr.Image(type="filepath", label="上传图片") # Create an image upload button
|
126 |
text_input = gr.Textbox(label="输入") # Create a text input box
|