Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,8 +14,9 @@ model_type = "vit_h"
|
|
14 |
sam = sam_model_registry[model_type](checkpoint=sam_checkpoint)
|
15 |
|
16 |
# Load the CLIP model
|
|
|
17 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
18 |
-
model
|
19 |
|
20 |
def find_similarity(base64_image, text_input):
|
21 |
try:
|
|
|
14 |
sam = sam_model_registry[model_type](checkpoint=sam_checkpoint)
|
15 |
|
16 |
# Load the CLIP model
|
17 |
+
model, preprocess = clip.load("ViT-B/32")
|
18 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
19 |
+
model.to(device).eval()
|
20 |
|
21 |
def find_similarity(base64_image, text_input):
|
22 |
try:
|