SajjadAyoubi commited on
Commit
936502b
·
1 Parent(s): ad93ba3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -32,7 +32,7 @@ st.cache(show_spinner=False)
32
  def image_search(query, top_k=10):
33
  with torch.no_grad():
34
  text_embedding = text_encoder(**tokenizer(query, return_tensors='pt')).pooler_output
35
- values, indices = torch.matmul(image_embeddings, text_embedding.T).sort(descending=True)
36
  return [links[i] for i in indices[:top_k]]
37
 
38
 
 
32
  def image_search(query, top_k=10):
33
  with torch.no_grad():
34
  text_embedding = text_encoder(**tokenizer(query, return_tensors='pt')).pooler_output
35
+ values, indices = (image_embeddings@text_embedding.T).sort(descending=True)
36
  return [links[i] for i in indices[:top_k]]
37
 
38