Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -270,7 +270,7 @@ def merge_pdfs(paths, output_path):
|
|
| 270 |
writer.write(f)
|
| 271 |
return output_path
|
| 272 |
|
| 273 |
-
def gemini_generate_content(prompt_text, file_upload_obj=None, image_obj=None, model_name="gemini-2.
|
| 274 |
"""
|
| 275 |
Send prompt_text and optionally an uploaded file (or an image object/list) to the model using NEW SDK.
|
| 276 |
Returns textual response and prints progress.
|
|
@@ -308,10 +308,10 @@ def gemini_generate_content(prompt_text, file_upload_obj=None, image_obj=None, m
|
|
| 308 |
except Exception as e:
|
| 309 |
print(f"❌ Generation failed: {e}")
|
| 310 |
# Try fallback model
|
| 311 |
-
print("⚡ Trying fallback model: gemini-
|
| 312 |
try:
|
| 313 |
response = client.models.generate_content(
|
| 314 |
-
model="gemini-
|
| 315 |
contents=contents
|
| 316 |
)
|
| 317 |
raw_text = response.text
|
|
|
|
| 270 |
writer.write(f)
|
| 271 |
return output_path
|
| 272 |
|
| 273 |
+
def gemini_generate_content(prompt_text, file_upload_obj=None, image_obj=None, model_name="gemini-2.5-pro"):
|
| 274 |
"""
|
| 275 |
Send prompt_text and optionally an uploaded file (or an image object/list) to the model using NEW SDK.
|
| 276 |
Returns textual response and prints progress.
|
|
|
|
| 308 |
except Exception as e:
|
| 309 |
print(f"❌ Generation failed: {e}")
|
| 310 |
# Try fallback model
|
| 311 |
+
print("⚡ Trying fallback model: gemini-2.5-flash")
|
| 312 |
try:
|
| 313 |
response = client.models.generate_content(
|
| 314 |
+
model="gemini-2.5-flash",
|
| 315 |
contents=contents
|
| 316 |
)
|
| 317 |
raw_text = response.text
|