Upload models/CLAP/open_clip/factory.py with huggingface_hub
Browse files
models/CLAP/open_clip/factory.py
CHANGED
|
@@ -52,7 +52,7 @@ _rescan_model_configs() # initial populate of model config registry
|
|
| 52 |
|
| 53 |
|
| 54 |
def load_state_dict(checkpoint_path: str, map_location="cpu", skip_params=True):
|
| 55 |
-
checkpoint = torch.load(checkpoint_path, map_location=map_location)
|
| 56 |
if isinstance(checkpoint, dict) and "state_dict" in checkpoint:
|
| 57 |
state_dict = checkpoint["state_dict"]
|
| 58 |
else:
|
|
|
|
| 52 |
|
| 53 |
|
| 54 |
def load_state_dict(checkpoint_path: str, map_location="cpu", skip_params=True):
|
| 55 |
+
checkpoint = torch.load(checkpoint_path, map_location=map_location, weights_only=False)
|
| 56 |
if isinstance(checkpoint, dict) and "state_dict" in checkpoint:
|
| 57 |
state_dict = checkpoint["state_dict"]
|
| 58 |
else:
|