Update app.py
Browse files
app.py
CHANGED
@@ -61,7 +61,7 @@ def process_text(text_input, unit):
|
|
61 |
response = job.result()
|
62 |
temp = response[1][0][1]
|
63 |
local_data.results = temp
|
64 |
-
|
65 |
|
66 |
|
67 |
|
@@ -105,10 +105,12 @@ def process_image(image_input, unit):
|
|
105 |
t = threading.Thread(target=update)
|
106 |
t.start()
|
107 |
local_data.results = "正在分析....."
|
108 |
-
|
109 |
|
110 |
def fetch_result():
|
111 |
init_data()
|
|
|
|
|
112 |
if local_data.results:
|
113 |
local_data.results = temp
|
114 |
return local_data.results
|
@@ -121,12 +123,13 @@ def reset_result():
|
|
121 |
local_data.results = ""
|
122 |
|
123 |
def main(text_input="", image_input=None, unit=""):
|
|
|
124 |
reset_result()
|
125 |
if text_input and image_input is None:
|
126 |
-
|
127 |
elif image_input is not None:
|
128 |
-
|
129 |
-
|
130 |
with gr.Blocks(css=css, title="家庭医生AI助手", theme="soft") as iface:
|
131 |
with gr.Accordion(""):
|
132 |
gr.Markdown(DESCRIPTION)
|
|
|
61 |
response = job.result()
|
62 |
temp = response[1][0][1]
|
63 |
local_data.results = temp
|
64 |
+
|
65 |
|
66 |
|
67 |
|
|
|
105 |
t = threading.Thread(target=update)
|
106 |
t.start()
|
107 |
local_data.results = "正在分析....."
|
108 |
+
|
109 |
|
110 |
def fetch_result():
|
111 |
init_data()
|
112 |
+
print(f'temp:{temp}')
|
113 |
+
print(f'local_data.results: {local_data.results}')
|
114 |
if local_data.results:
|
115 |
local_data.results = temp
|
116 |
return local_data.results
|
|
|
123 |
local_data.results = ""
|
124 |
|
125 |
def main(text_input="", image_input=None, unit=""):
|
126 |
+
init_data()
|
127 |
reset_result()
|
128 |
if text_input and image_input is None:
|
129 |
+
process_text(text_input, unit)
|
130 |
elif image_input is not None:
|
131 |
+
process_image(image_input, unit)
|
132 |
+
return local_data.results
|
133 |
with gr.Blocks(css=css, title="家庭医生AI助手", theme="soft") as iface:
|
134 |
with gr.Accordion(""):
|
135 |
gr.Markdown(DESCRIPTION)
|