Spaces:
Build error
Build error
fix: import create_model_from_pretrained
Browse files- models/siglip_model.py +9 -9
models/siglip_model.py
CHANGED
|
@@ -40,15 +40,15 @@ class SigLIPModel:
|
|
| 40 |
print(f"Warning: Checkpoint not found at {self.ckpt_path}")
|
| 41 |
|
| 42 |
if 'hf' in self.ckpt_path:
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
self.model = self.model.to(self.device)
|
| 53 |
self.model.eval()
|
| 54 |
|
|
|
|
| 40 |
print(f"Warning: Checkpoint not found at {self.ckpt_path}")
|
| 41 |
|
| 42 |
if 'hf' in self.ckpt_path:
|
| 43 |
+
from open_clip import create_model_from_pretrained, get_tokenizer # works on open-clip-torch>=2.23.0, timm>=0.9.8
|
| 44 |
+
|
| 45 |
+
model, preprocess = create_model_from_pretrained('hf-hub:timm/ViT-SO400M-14-SigLIP-384')
|
| 46 |
+
tokenizer = get_tokenizer('hf-hub:timm/ViT-SO400M-14-SigLIP-384')
|
| 47 |
+
|
| 48 |
+
# model, preprocess = create_model_from_pretrained('hf-hub:timm/ViT-SO400M-14-SigLIP-384')
|
| 49 |
+
# from huggingface_hub import hf_hub_download
|
| 50 |
+
# tokenizer = get_tokenizer('hf-hub:timm/ViT-SO400M-14-SigLIP-384')
|
| 51 |
+
|
| 52 |
self.model = self.model.to(self.device)
|
| 53 |
self.model.eval()
|
| 54 |
|