Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,9 +14,12 @@ model_type = "vit_h"
|
|
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.
|
20 |
|
21 |
def find_similarity(base64_image, text_input):
|
22 |
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 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
22 |
+
model, preprocess = clip.load("ViT-B/32", device=device)
|
23 |
|
24 |
def find_similarity(base64_image, text_input):
|
25 |
try:
|