Spaces:
Build error
Build error
Commit
·
fde2555
1
Parent(s):
e9213d0
app.py
Browse files
app.py
CHANGED
@@ -39,8 +39,8 @@ def show_output_image(matched_images) :
|
|
39 |
# Encode and normalize the search query using CLIP
|
40 |
def encode_search_query(search_query, model):
|
41 |
with torch.no_grad():
|
42 |
-
|
43 |
-
inputs = processor(text=[search_query], images=None, return_tensors="pt", padding=True)
|
44 |
text_features = model.get_text_features(**inputs).detach().numpy()
|
45 |
return np.array(text_features)
|
46 |
|
|
|
39 |
# Encode and normalize the search query using CLIP
|
40 |
def encode_search_query(search_query, model):
|
41 |
with torch.no_grad():
|
42 |
+
inputs = tokenizer([search_query], padding=True, return_tensors="pt")
|
43 |
+
#inputs = processor(text=[search_query], images=None, return_tensors="pt", padding=True)
|
44 |
text_features = model.get_text_features(**inputs).detach().numpy()
|
45 |
return np.array(text_features)
|
46 |
|