Spaces:
Runtime error
Runtime error
Update recommendation.py
Browse files- recommendation.py +1 -1
recommendation.py
CHANGED
|
@@ -36,7 +36,7 @@ def get_recommendations(image, title, k):
|
|
| 36 |
title_embeds = model.encode([title], normalize_embeddings=True)
|
| 37 |
image = transforms.ToTensor()(image.convert("L"))
|
| 38 |
image_embeds = encoder(image).detach().numpy()
|
| 39 |
-
image_embeds = image_embeds / np.linalg.norm(image_embeds, axis=1, keepdims=True)
|
| 40 |
final_embeds = np.concatenate((image_embeds,title_embeds), axis=1)
|
| 41 |
|
| 42 |
# candidates = index.topk(final_embeds,k=k)
|
|
|
|
| 36 |
title_embeds = model.encode([title], normalize_embeddings=True)
|
| 37 |
image = transforms.ToTensor()(image.convert("L"))
|
| 38 |
image_embeds = encoder(image).detach().numpy()
|
| 39 |
+
# image_embeds = image_embeds / np.linalg.norm(image_embeds, axis=1, keepdims=True)
|
| 40 |
final_embeds = np.concatenate((image_embeds,title_embeds), axis=1)
|
| 41 |
|
| 42 |
# candidates = index.topk(final_embeds,k=k)
|