Spaces:
Runtime error
Runtime error
Samuel Schmidt
commited on
Commit
·
a5c02ba
1
Parent(s):
a755fb2
Updated dataset embedding
Browse files- src/app.py +2 -2
src/app.py
CHANGED
@@ -20,10 +20,10 @@ def emb_dataset(dataset):
|
|
20 |
|
21 |
## CLIP Embeddings
|
22 |
clip_model = CLIPImageEncoder()
|
23 |
-
dataset_with_embeddings =
|
24 |
dataset_with_embeddings.add_faiss_index(column='clip_embeddings')
|
25 |
-
dataset_with_embeddings # Just to check, if okay
|
26 |
|
|
|
27 |
return dataset_with_embeddings
|
28 |
|
29 |
dataset_with_embeddings = emb_dataset(candidate_subset)
|
|
|
20 |
|
21 |
## CLIP Embeddings
|
22 |
clip_model = CLIPImageEncoder()
|
23 |
+
dataset_with_embeddings = dataset_with_embeddings.map(lambda row: {'clip_embeddings': clip_model.encode_image(row["image"])})
|
24 |
dataset_with_embeddings.add_faiss_index(column='clip_embeddings')
|
|
|
25 |
|
26 |
+
print(dataset_with_embeddings)
|
27 |
return dataset_with_embeddings
|
28 |
|
29 |
dataset_with_embeddings = emb_dataset(candidate_subset)
|