Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
|
@@ -144,11 +144,11 @@ def analyze_image_with_text(image_path: str, user_text: str) -> str:
|
|
| 144 |
if not os.path.exists(image_path):
|
| 145 |
return "圖片路徑無效,無法進行分析。"
|
| 146 |
|
| 147 |
-
img_user = PIL.Image.open(image_path)
|
| 148 |
print(user_text)
|
| 149 |
response = genai_client.models.generate_content(
|
| 150 |
-
model="gemini-2.
|
| 151 |
-
contents=
|
| 152 |
)
|
| 153 |
|
| 154 |
if (response.text != None):
|
|
|
|
| 144 |
if not os.path.exists(image_path):
|
| 145 |
return "圖片路徑無效,無法進行分析。"
|
| 146 |
|
| 147 |
+
# img_user = PIL.Image.open(image_path)
|
| 148 |
print(user_text)
|
| 149 |
response = genai_client.models.generate_content(
|
| 150 |
+
model="gemini-2.0-flash-preview-image-generation",
|
| 151 |
+
contents=f"請根據這張圖片回答問題。圖片的路徑是:{image_path},我的問題是:{user_text}"
|
| 152 |
)
|
| 153 |
|
| 154 |
if (response.text != None):
|