Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -165,7 +165,13 @@ def search(query: str, ds, images, k, api_key):
|
|
165 |
# Get the top k images
|
166 |
results = []
|
167 |
for idx in top_k_indices:
|
168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
|
170 |
# Generate response from Gemini
|
171 |
ai_response = query_gemini(query, results, api_key)
|
|
|
165 |
# Get the top k images
|
166 |
results = []
|
167 |
for idx in top_k_indices:
|
168 |
+
img = images[idx]
|
169 |
+
# buffered = BytesIO()
|
170 |
+
# img.save(buffered, format="JPEG")
|
171 |
+
# img_processed = Image.open(BytesIO(buffered.getvalue()))
|
172 |
+
img_copy = img.copy()
|
173 |
+
results.append((img_copy, f"Page {idx}"))
|
174 |
+
# results.append((images[idx], f"Page {idx}"))
|
175 |
|
176 |
# Generate response from Gemini
|
177 |
ai_response = query_gemini(query, results, api_key)
|