Spaces:
Sleeping
Sleeping
Update Uploading_images_file.py
Browse files- Uploading_images_file.py +2 -2
Uploading_images_file.py
CHANGED
|
@@ -40,8 +40,8 @@ def analyze_with_gemini(image_path, user_text):
|
|
| 40 |
if not os.path.exists(image_path):
|
| 41 |
raise FileNotFoundError(f"圖片路徑無效:{image_path}")
|
| 42 |
|
| 43 |
-
|
| 44 |
-
response = chat.send_message([user_text,
|
| 45 |
|
| 46 |
# 提取回應內容
|
| 47 |
return response.text
|
|
|
|
| 40 |
if not os.path.exists(image_path):
|
| 41 |
raise FileNotFoundError(f"圖片路徑無效:{image_path}")
|
| 42 |
|
| 43 |
+
img_user = PIL.Image.open(image_path)
|
| 44 |
+
response = chat.send_message([user_text, img_user)])
|
| 45 |
|
| 46 |
# 提取回應內容
|
| 47 |
return response.text
|