Update app.py
Browse files
app.py
CHANGED
@@ -66,9 +66,14 @@ def process_image(image_input, unit):
|
|
66 |
client = Client(client_vl, upload_files=False)
|
67 |
# base64_image = encode_image_to_base64(image_input)
|
68 |
prompt = f" You are a experienced {unit} doctor AI assistant." + SYS_PROMPT + "Help me understand what is in this picture and analysis."
|
69 |
-
|
|
|
70 |
image_input,
|
71 |
-
|
|
|
|
|
|
|
|
|
72 |
fn_index=0
|
73 |
)
|
74 |
print(response)
|
@@ -89,7 +94,7 @@ with gr.Blocks(theme='soft', css=css, title="家庭医生AI助手") as iface:
|
|
89 |
"整形美容科", "营养科", "生殖中心", "麻醉医学科", "医学影像科", \
|
90 |
"骨科", "肿瘤科", "急诊科", "检验科"])
|
91 |
with gr.Row():
|
92 |
-
output_box = gr.
|
93 |
with gr.Row():
|
94 |
image_input = gr.Image(type="filepath", label="上传图片") # Create an image upload button
|
95 |
text_input = gr.Textbox(label="输入") # Create a text input box
|
|
|
66 |
client = Client(client_vl, upload_files=False)
|
67 |
# base64_image = encode_image_to_base64(image_input)
|
68 |
prompt = f" You are a experienced {unit} doctor AI assistant." + SYS_PROMPT + "Help me understand what is in this picture and analysis."
|
69 |
+
client.predict(
|
70 |
+
"null",
|
71 |
image_input,
|
72 |
+
fn_index=5
|
73 |
+
)
|
74 |
+
response = client.predict(
|
75 |
+
"null",
|
76 |
+
prompt,
|
77 |
fn_index=0
|
78 |
)
|
79 |
print(response)
|
|
|
94 |
"整形美容科", "营养科", "生殖中心", "麻醉医学科", "医学影像科", \
|
95 |
"骨科", "肿瘤科", "急诊科", "检验科"])
|
96 |
with gr.Row():
|
97 |
+
output_box = gr.Textbox(label="分析") # Create an output textbox
|
98 |
with gr.Row():
|
99 |
image_input = gr.Image(type="filepath", label="上传图片") # Create an image upload button
|
100 |
text_input = gr.Textbox(label="输入") # Create a text input box
|