atz21 commited on
Commit
f1f0ca1
·
verified ·
1 Parent(s): f92014f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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.0-flash-exp"):
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-1.5-flash")
312
  try:
313
  response = client.models.generate_content(
314
- model="gemini-1.5-flash",
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