murcherful commited on
Commit
b329544
·
1 Parent(s): be58a6f

fix load state dict

Browse files
Files changed (1) hide show
  1. P3-SAM/model.py +1 -1
P3-SAM/model.py CHANGED
@@ -120,7 +120,7 @@ def load_state_dict(self,
120
  from huggingface_hub import hf_hub_download
121
  ckpt_path = hf_hub_download(repo_id="tencent/Hunyuan3D-Part", filename="p3sam.ckpt", local_dir='cache/P3-SAM/')
122
  print(f'download model from huggingface to: {ckpt_path}')
123
- state_dict = torch.load(ckpt_path, map_location="cpu")["state_dict"]
124
 
125
  local_state_dict = self.state_dict()
126
  seen_keys = {k: False for k in local_state_dict.keys()}
 
120
  from huggingface_hub import hf_hub_download
121
  ckpt_path = hf_hub_download(repo_id="tencent/Hunyuan3D-Part", filename="p3sam.ckpt", local_dir='cache/P3-SAM/')
122
  print(f'download model from huggingface to: {ckpt_path}')
123
+ state_dict = torch.load(ckpt_path, weights_only=False, map_location="cpu")["state_dict"]
124
 
125
  local_state_dict = self.state_dict()
126
  seen_keys = {k: False for k in local_state_dict.keys()}