SajjadAyoubi commited on
Commit
225ca56
·
1 Parent(s): 91228a0

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=224):
30
  def compute_embeddings(query):
31
  with torch.no_grad():
32
  return text_encoder(**tokenizer(query, return_tensors='pt')).pooler_output
33
-
34
- @st.cache(show_spinner=False)
35
  def image_search(query, top_k=8):
36
  text_embedding = compute_embeddings(query)
37
  values, indices = torch.cosine_similarity(text_embedding, image_embeddings).sort(descending=True)
 
30
  def compute_embeddings(query):
31
  with torch.no_grad():
32
  return text_encoder(**tokenizer(query, return_tensors='pt')).pooler_output
33
+
34
+
35
  def image_search(query, top_k=8):
36
  text_embedding = compute_embeddings(query)
37
  values, indices = torch.cosine_similarity(text_embedding, image_embeddings).sort(descending=True)