Vijish commited on
Commit
21ef9b6
1 Parent(s): eef1453

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -71,11 +71,11 @@ def predict(text,img):
71
  top_N_images.append(l[index])
72
  return scores,top_N_images
73
 
74
- search_query = text
75
 
76
  with torch.no_grad():
77
  # Encode and normalize the description using CLIP
78
- text_encoded = model.encode_text(clip.tokenize(search_query).to(device))
79
  text_encoded /= text_encoded.norm(dim=-1, keepdim=True)
80
 
81
  similarity = text_encoded.cpu().numpy() @ image_features.cpu().numpy().T
 
71
  top_N_images.append(l[index])
72
  return scores,top_N_images
73
 
74
+ #search_query = text
75
 
76
  with torch.no_grad():
77
  # Encode and normalize the description using CLIP
78
+ text_encoded = model.encode_text(clip.tokenize(text).to(device))
79
  text_encoded /= text_encoded.norm(dim=-1, keepdim=True)
80
 
81
  similarity = text_encoded.cpu().numpy() @ image_features.cpu().numpy().T