Nechba commited on
Commit
c3317ef
·
verified ·
1 Parent(s): 8776155

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +5 -1
utils.py CHANGED
@@ -99,7 +99,11 @@ def analyze_pdf_images_with_gemini(pdf_bytes):
99
  contents = [question]
100
  for img in images:
101
  img_bytes = pil_image_to_bytes(img)
102
- contents.append(genai.types.Part.from_bytes(data=img_bytes, mime_type="image/jpeg"))
 
 
 
 
103
 
104
  # Generate content using Gemini
105
  model = genai.GenerativeModel('gemini-2.0-flash') # Updated model name
 
99
  contents = [question]
100
  for img in images:
101
  img_bytes = pil_image_to_bytes(img)
102
+ contents.append({
103
+ 'mime_type': 'image/jpeg',
104
+ 'data': img_bytes
105
+ })
106
+ #contents.append(genai.types.Part.from_bytes(data=img_bytes, mime_type="image/jpeg"))
107
 
108
  # Generate content using Gemini
109
  model = genai.GenerativeModel('gemini-2.0-flash') # Updated model name