Update app.py
Browse files
app.py
CHANGED
@@ -68,7 +68,8 @@ def process_text(text_input, unit):
|
|
68 |
elif text_input and endpoints == "GOOGLE":
|
69 |
genai.configure(api_key=api_key)
|
70 |
model = genai.GenerativeModel(model_name=model_name),
|
71 |
-
|
|
|
72 |
return response.text
|
73 |
return ""
|
74 |
|
@@ -104,7 +105,8 @@ def process_image(image_input, unit):
|
|
104 |
elif image_input is not None and endpoints == "GOOGLE":
|
105 |
genai.configure(api_key=api_key)
|
106 |
model = genai.GenerativeModel(model_name=model_name),
|
107 |
-
|
|
|
108 |
return response.text
|
109 |
|
110 |
def main(api_key="", text_input="", image_input=None, unit=""):
|
|
|
68 |
elif text_input and endpoints == "GOOGLE":
|
69 |
genai.configure(api_key=api_key)
|
70 |
model = genai.GenerativeModel(model_name=model_name),
|
71 |
+
prompt = f" You are a experienced {unit} doctor." + SYS_PROMPT + f"Could you solve {text_input}?",
|
72 |
+
response = model.generate_content(prompt)
|
73 |
return response.text
|
74 |
return ""
|
75 |
|
|
|
105 |
elif image_input is not None and endpoints == "GOOGLE":
|
106 |
genai.configure(api_key=api_key)
|
107 |
model = genai.GenerativeModel(model_name=model_name),
|
108 |
+
prompt = f" You are a experienced {unit} doctor." + SYS_PROMPT + "Help me understand what is in this picture and analysis.",
|
109 |
+
response = model.generate_content([prompt, image_input],request_options={"timeout": 60})
|
110 |
return response.text
|
111 |
|
112 |
def main(api_key="", text_input="", image_input=None, unit=""):
|