Spaces:
Sleeping
Sleeping
dmayboroda
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -13,14 +13,14 @@ from usearch.index import Index
|
|
13 |
dataset = load_dataset("dmayboroda/sk-test_1")
|
14 |
|
15 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
16 |
-
clipmodel, preprocess = clip.load("ViT-
|
17 |
|
18 |
-
model_name = 'M-CLIP/
|
19 |
model = pt_multilingual_clip.MultilingualCLIP.from_pretrained(model_name)
|
20 |
tokenizer = transformers.AutoTokenizer.from_pretrained(model_name)
|
21 |
model.to(device)
|
22 |
|
23 |
-
index = Index(ndim=
|
24 |
|
25 |
img_embeddings = []
|
26 |
emb_to_img = {}
|
|
|
13 |
dataset = load_dataset("dmayboroda/sk-test_1")
|
14 |
|
15 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
16 |
+
clipmodel, preprocess = clip.load("ViT-B/32", device=device)
|
17 |
|
18 |
+
model_name = 'M-CLIP/XLM-Roberta-Large-Vit-B-32'
|
19 |
model = pt_multilingual_clip.MultilingualCLIP.from_pretrained(model_name)
|
20 |
tokenizer = transformers.AutoTokenizer.from_pretrained(model_name)
|
21 |
model.to(device)
|
22 |
|
23 |
+
index = Index(ndim=512, metric='cos', dtype='f32')
|
24 |
|
25 |
img_embeddings = []
|
26 |
emb_to_img = {}
|