Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
be58a6f
1
Parent(s):
454fc3e
fix load state dict
Browse files- P3-SAM/model.py +1 -1
P3-SAM/model.py
CHANGED
|
@@ -113,7 +113,7 @@ def load_state_dict(self,
|
|
| 113 |
ignore_seg_s2_mlp=False,
|
| 114 |
ignore_iou_mlp=False):
|
| 115 |
if ckpt_path is not None:
|
| 116 |
-
state_dict = torch.load(ckpt_path, map_location="cpu")["state_dict"]
|
| 117 |
elif state_dict is None:
|
| 118 |
# download from huggingface
|
| 119 |
print(f'trying to download model from huggingface...')
|
|
|
|
| 113 |
ignore_seg_s2_mlp=False,
|
| 114 |
ignore_iou_mlp=False):
|
| 115 |
if ckpt_path is not None:
|
| 116 |
+
state_dict = torch.load(ckpt_path, weights_only=False, map_location="cpu")["state_dict"]
|
| 117 |
elif state_dict is None:
|
| 118 |
# download from huggingface
|
| 119 |
print(f'trying to download model from huggingface...')
|