SajjadAyoubi commited on
Commit
9492b8f
·
1 Parent(s): 16b83cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -30,8 +30,8 @@ def get_html(url_list, height=180):
30
  html += "</div>"
31
  return html
32
 
33
- @st.cache(show_spinner=False)
34
- def image_search(query, top_k=8):
35
  with torch.no_grad():
36
  text_embedding = text_encoder(**tokenizer(query, return_tensors='pt')).pooler_output
37
  values, indices = torch.cosine_similarity(text_embedding, image_embeddings).sort(descending=True)
 
30
  html += "</div>"
31
  return html
32
 
33
+
34
+ def image_search(query, top_k=10):
35
  with torch.no_grad():
36
  text_embedding = text_encoder(**tokenizer(query, return_tensors='pt')).pooler_output
37
  values, indices = torch.cosine_similarity(text_embedding, image_embeddings).sort(descending=True)