Spaces:
Running
Running
update gemini version
Browse files
app.py
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
import gc
|
| 3 |
import torch
|
|
@@ -134,7 +142,7 @@ def image_to_data_uri(image: Image.Image) -> str:
|
|
| 134 |
# ============================================================================
|
| 135 |
def generate_captions_gemini(image: Image.Image) -> list:
|
| 136 |
|
| 137 |
-
model = genai.GenerativeModel("gemini-
|
| 138 |
|
| 139 |
prompts = [
|
| 140 |
"Describe this image in detail covering the overall scene.",
|
|
|
|
| 1 |
+
# Add this temporarily at the top of your app to list available models
|
| 2 |
+
import google.generativeai as genai
|
| 3 |
+
genai.configure(api_key=GOOGLE_API_KEY)
|
| 4 |
+
|
| 5 |
+
for m in genai.list_models():
|
| 6 |
+
if "generateContent" in m.supported_generation_methods:
|
| 7 |
+
st.write(m.name)
|
| 8 |
+
|
| 9 |
import os
|
| 10 |
import gc
|
| 11 |
import torch
|
|
|
|
| 142 |
# ============================================================================
|
| 143 |
def generate_captions_gemini(image: Image.Image) -> list:
|
| 144 |
|
| 145 |
+
model = genai.GenerativeModel("gemini-2.0-flash")
|
| 146 |
|
| 147 |
prompts = [
|
| 148 |
"Describe this image in detail covering the overall scene.",
|