Update app.py
Browse files
app.py
CHANGED
@@ -43,7 +43,7 @@ LICENSE = '采用 ' + MODEL_NAME + ' 模型'
|
|
43 |
|
44 |
|
45 |
def process_text(text_input, unit):
|
46 |
-
client = Client(client_chat
|
47 |
response = client.predict(
|
48 |
query=str(text_input),
|
49 |
history=None,
|
@@ -51,7 +51,6 @@ def process_text(text_input, unit):
|
|
51 |
api_name="/model_chat"
|
52 |
)
|
53 |
return response[1][0]
|
54 |
-
|
55 |
|
56 |
def encode_image_to_base64(image_input):
|
57 |
buffered = io.BytesIO()
|
@@ -64,7 +63,7 @@ def process_image(image_input, unit):
|
|
64 |
print(image_input)
|
65 |
#with open(image_input, "rb") as f:
|
66 |
# base64_image = base64.b64encode(f.read()).decode("utf-8")
|
67 |
-
client = Client(client_vl,
|
68 |
# base64_image = encode_image_to_base64(image_input)
|
69 |
prompt = f" You are a experienced {unit} doctor AI assistant." + SYS_PROMPT + "Help me understand what is in this picture and analysis."
|
70 |
response = client.predict(
|
|
|
43 |
|
44 |
|
45 |
def process_text(text_input, unit):
|
46 |
+
client = Client(client_chat)
|
47 |
response = client.predict(
|
48 |
query=str(text_input),
|
49 |
history=None,
|
|
|
51 |
api_name="/model_chat"
|
52 |
)
|
53 |
return response[1][0]
|
|
|
54 |
|
55 |
def encode_image_to_base64(image_input):
|
56 |
buffered = io.BytesIO()
|
|
|
63 |
print(image_input)
|
64 |
#with open(image_input, "rb") as f:
|
65 |
# base64_image = base64.b64encode(f.read()).decode("utf-8")
|
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 |
response = client.predict(
|