Update app.py
Browse files
app.py
CHANGED
@@ -68,8 +68,8 @@ def normalized(a: torch.Tensor, order=2, dim=-1):
|
|
68 |
return a / l2
|
69 |
|
70 |
def load_clip_models(name: str = "ViT-L/14", device='cuda'):
|
71 |
-
import
|
72 |
-
model2, preprocess =
|
73 |
return model2, preprocess
|
74 |
|
75 |
def load_model(model_path: str, input_size=768, device: str = 'cuda', dtype=None):
|
|
|
68 |
return a / l2
|
69 |
|
70 |
def load_clip_models(name: str = "ViT-L/14", device='cuda'):
|
71 |
+
import open_clip
|
72 |
+
model2, preprocess = open_clip.create_model_and_transforms(name, device=device)
|
73 |
return model2, preprocess
|
74 |
|
75 |
def load_model(model_path: str, input_size=768, device: str = 'cuda', dtype=None):
|