Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -260,7 +260,7 @@ def merge_pdfs(paths, output_path):
|
|
| 260 |
writer.write(f)
|
| 261 |
return output_path
|
| 262 |
|
| 263 |
-
def gemini_generate_content(prompt_text, file_upload_obj=None, image_obj=None, model_name="gemini-2.
|
| 264 |
"""
|
| 265 |
Send prompt_text and optionally an uploaded file (or an image object/list) to the model using NEW SDK.
|
| 266 |
Returns textual response and prints progress.
|
|
@@ -298,10 +298,10 @@ def gemini_generate_content(prompt_text, file_upload_obj=None, image_obj=None, m
|
|
| 298 |
except Exception as e:
|
| 299 |
print(f"❌ Generation failed: {e}")
|
| 300 |
# Try fallback model
|
| 301 |
-
print("⚡ Trying fallback model: gemini-
|
| 302 |
try:
|
| 303 |
response = client.models.generate_content(
|
| 304 |
-
model="gemini-
|
| 305 |
contents=contents
|
| 306 |
)
|
| 307 |
raw_text = response.text
|
|
|
|
| 260 |
writer.write(f)
|
| 261 |
return output_path
|
| 262 |
|
| 263 |
+
def gemini_generate_content(prompt_text, file_upload_obj=None, image_obj=None, model_name="gemini-2.5-pro"):
|
| 264 |
"""
|
| 265 |
Send prompt_text and optionally an uploaded file (or an image object/list) to the model using NEW SDK.
|
| 266 |
Returns textual response and prints progress.
|
|
|
|
| 298 |
except Exception as e:
|
| 299 |
print(f"❌ Generation failed: {e}")
|
| 300 |
# Try fallback model
|
| 301 |
+
print("⚡ Trying fallback model: gemini-2.5-flash")
|
| 302 |
try:
|
| 303 |
response = client.models.generate_content(
|
| 304 |
+
model="gemini-2.5-flash",
|
| 305 |
contents=contents
|
| 306 |
)
|
| 307 |
raw_text = response.text
|