Spaces:
Runtime error
Runtime error
fix variable name
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ def find_similar(image):
|
|
24 |
## Inference
|
25 |
with torch.no_grad():
|
26 |
photo_preprocessed = processor(text=None, images=image, return_tensors="pt", padding=True)["pixel_values"]
|
27 |
-
search_photo_feature = model.get_image_features(
|
28 |
search_photo_feature /= search_photo_feature.norm(dim=-1, keepdim=True)
|
29 |
search_photos_feature = search_photos_feature.cpu().numpy()
|
30 |
|
|
|
24 |
## Inference
|
25 |
with torch.no_grad():
|
26 |
photo_preprocessed = processor(text=None, images=image, return_tensors="pt", padding=True)["pixel_values"]
|
27 |
+
search_photo_feature = model.get_image_features(photo_preprocessed.to(device))
|
28 |
search_photo_feature /= search_photo_feature.norm(dim=-1, keepdim=True)
|
29 |
search_photos_feature = search_photos_feature.cpu().numpy()
|
30 |
|