Vijish commited on
Commit
c9e7eac
1 Parent(s): e3307e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -75,7 +75,7 @@ def predict(text,img):
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
 
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