Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -361,7 +361,7 @@ def merge_pdfs(paths, output_path):
|
|
| 361 |
writer.write(f)
|
| 362 |
return output_path
|
| 363 |
|
| 364 |
-
def gemini_generate_content(prompt_text, file_upload_obj=None, image_obj=None, model_name="gemini-2.
|
| 365 |
"""
|
| 366 |
Send prompt_text and optionally an uploaded file (or an image object/list) to the model using NEW SDK.
|
| 367 |
Returns textual response and prints progress.
|
|
@@ -399,10 +399,10 @@ def gemini_generate_content(prompt_text, file_upload_obj=None, image_obj=None, m
|
|
| 399 |
except Exception as e:
|
| 400 |
print(f"❌ Generation failed: {e}")
|
| 401 |
# Try fallback model
|
| 402 |
-
print("⚡ Trying fallback model: gemini-
|
| 403 |
try:
|
| 404 |
response = client.models.generate_content(
|
| 405 |
-
model="gemini-
|
| 406 |
contents=contents
|
| 407 |
)
|
| 408 |
raw_text = response.text
|
|
|
|
| 361 |
writer.write(f)
|
| 362 |
return output_path
|
| 363 |
|
| 364 |
+
def gemini_generate_content(prompt_text, file_upload_obj=None, image_obj=None, model_name="gemini-2.5-pro"):
|
| 365 |
"""
|
| 366 |
Send prompt_text and optionally an uploaded file (or an image object/list) to the model using NEW SDK.
|
| 367 |
Returns textual response and prints progress.
|
|
|
|
| 399 |
except Exception as e:
|
| 400 |
print(f"❌ Generation failed: {e}")
|
| 401 |
# Try fallback model
|
| 402 |
+
print("⚡ Trying fallback model: gemini-2.5-flash")
|
| 403 |
try:
|
| 404 |
response = client.models.generate_content(
|
| 405 |
+
model="gemini-2.5-flash",
|
| 406 |
contents=contents
|
| 407 |
)
|
| 408 |
raw_text = response.text
|