alanchen1115 commited on
Commit
a17c006
·
verified ·
1 Parent(s): bb47327

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +1 -2
main.py CHANGED
@@ -146,7 +146,6 @@ def analyze_image_with_text(image_path: str, user_text: str) -> str:
146
  img_user = PIL.Image.open(image_path)
147
  response = genai_client.models.generate_content(
148
  model="gemini-2.5-flash",
149
- temperature=0.3,
150
  contents=[img_user, user_text]
151
  )
152
  if (response.text != None):
@@ -155,7 +154,7 @@ def analyze_image_with_text(image_path: str, user_text: str) -> str:
155
  out = "Gemini沒答案!請換個說法!"
156
  except Exception as e:
157
  # 處理錯誤
158
- out = "Gemini執行出錯: {e}"
159
 
160
  return out
161
 
 
146
  img_user = PIL.Image.open(image_path)
147
  response = genai_client.models.generate_content(
148
  model="gemini-2.5-flash",
 
149
  contents=[img_user, user_text]
150
  )
151
  if (response.text != None):
 
154
  out = "Gemini沒答案!請換個說法!"
155
  except Exception as e:
156
  # 處理錯誤
157
+ out = f"Gemini執行出錯: {e}"
158
 
159
  return out
160