Spaces:
Runtime error
Runtime error
Commit
·
9492b8f
1
Parent(s):
16b83cd
Update app.py
Browse files
app.py
CHANGED
@@ -30,8 +30,8 @@ def get_html(url_list, height=180):
|
|
30 |
html += "</div>"
|
31 |
return html
|
32 |
|
33 |
-
|
34 |
-
def image_search(query, top_k=
|
35 |
with torch.no_grad():
|
36 |
text_embedding = text_encoder(**tokenizer(query, return_tensors='pt')).pooler_output
|
37 |
values, indices = torch.cosine_similarity(text_embedding, image_embeddings).sort(descending=True)
|
|
|
30 |
html += "</div>"
|
31 |
return html
|
32 |
|
33 |
+
|
34 |
+
def image_search(query, top_k=10):
|
35 |
with torch.no_grad():
|
36 |
text_embedding = text_encoder(**tokenizer(query, return_tensors='pt')).pooler_output
|
37 |
values, indices = torch.cosine_similarity(text_embedding, image_embeddings).sort(descending=True)
|