sitammeur commited on
Commit
55b884c
·
verified ·
1 Parent(s): b03f25e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
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
- results.append((images[idx], f"Page {idx}"))
 
 
 
 
 
 
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)