vilarin commited on
Commit
0a54041
·
verified ·
1 Parent(s): 7dd107c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -70,7 +70,8 @@ def process_text(text_input, unit):
70
  elif text_input and endpoints == "GOOGLE":
71
  genai.configure(api_key=GOOGLE_API_KEY)
72
  model = genai.GenerativeModel(MODEL),
73
- return response = model.generate_content(SYS_PROMPT + text_input).text
 
74
  return ""
75
 
76
  def encode_image_to_base64(image_input):
@@ -105,8 +106,8 @@ def process_image(image_input, unit):
105
  elif image_input is not None and ENDPOINTS == "GOOGLE":
106
  genai.configure(api_key=GOOGLE_API_KEY)
107
  model = genai.GenerativeModel(MODEL),
108
- return response = model.generate_content(image_input).text
109
-
110
 
111
  def main(text_input="", image_input=None, unit=""):
112
  if text_input and image_input is None:
 
70
  elif text_input and endpoints == "GOOGLE":
71
  genai.configure(api_key=GOOGLE_API_KEY)
72
  model = genai.GenerativeModel(MODEL),
73
+ response = model.generate_content(f" You are a experienced {unit} doctor." + SYS_PROMPT + f"Could you solve {text_input}?")
74
+ return response.text
75
  return ""
76
 
77
  def encode_image_to_base64(image_input):
 
106
  elif image_input is not None and ENDPOINTS == "GOOGLE":
107
  genai.configure(api_key=GOOGLE_API_KEY)
108
  model = genai.GenerativeModel(MODEL),
109
+ response = model.generate_content([f" You are a experienced {unit} doctor." + SYS_PROMPT + "Help me understand what is in this picture and analysis.", image_input])
110
+ return response.text
111
 
112
  def main(text_input="", image_input=None, unit=""):
113
  if text_input and image_input is None: