Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -148,8 +148,14 @@ def generate_response(image_path, question):
|
|
148 |
try:
|
149 |
image_data = Image.open(image_path)
|
150 |
response = client.models.generate_content(
|
151 |
-
model="gemini-2.
|
152 |
-
contents=[image_data, prompt]
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
)
|
154 |
answer = response.candidates[0].content.parts[0].text
|
155 |
return answer.strip()
|
|
|
148 |
try:
|
149 |
image_data = Image.open(image_path)
|
150 |
response = client.models.generate_content(
|
151 |
+
model="gemini-2.5-flash-preview-04-17",
|
152 |
+
contents=[image_data, prompt],
|
153 |
+
config=types.GenerateContentConfig(
|
154 |
+
thinking_config=types.ThinkingConfig(
|
155 |
+
thinking_budget=8000
|
156 |
+
)
|
157 |
+
)
|
158 |
+
|
159 |
)
|
160 |
answer = response.candidates[0].content.parts[0].text
|
161 |
return answer.strip()
|