Spaces:
Sleeping
Sleeping
Update main.py
Browse files
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 |
|