atz21 commited on
Commit
8463bc7
·
verified ·
1 Parent(s): 8a6f64a

Update app.py

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