Spaces:
Sleeping
Sleeping
Update utils.py
Browse files
utils.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
import google.generativeai as genai
|
2 |
-
from google.genai import types
|
3 |
|
4 |
|
5 |
genai.configure(api_key="AIzaSyAP85jSUKncrIGOAhm3Gvo-TYra_e1wmEA")
|
@@ -100,7 +99,7 @@ def analyze_pdf_images_with_gemini(pdf_bytes):
|
|
100 |
contents = [question]
|
101 |
for img in images:
|
102 |
img_bytes = pil_image_to_bytes(img)
|
103 |
-
contents.append(types.Part.from_bytes(data=img_bytes, mime_type="image/jpeg"))
|
104 |
|
105 |
# Generate content using Gemini
|
106 |
model = genai.GenerativeModel('gemini-2.0-flash') # Updated model name
|
|
|
1 |
import google.generativeai as genai
|
|
|
2 |
|
3 |
|
4 |
genai.configure(api_key="AIzaSyAP85jSUKncrIGOAhm3Gvo-TYra_e1wmEA")
|
|
|
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
|