IFMedTechdemo commited on
Commit
85029f5
·
verified ·
1 Parent(s): 2c610b9

Upload models/sam/segment_anything/build_sam.py with huggingface_hub

Browse files
models/sam/segment_anything/build_sam.py CHANGED
@@ -102,6 +102,6 @@ def _build_sam(
102
  sam.eval()
103
  if checkpoint is not None:
104
  with open(checkpoint, "rb") as f:
105
- state_dict = torch.load(f)
106
  sam.load_state_dict(state_dict)
107
  return sam
 
102
  sam.eval()
103
  if checkpoint is not None:
104
  with open(checkpoint, "rb") as f:
105
+ state_dict = torch.load(f, weights_only=False)
106
  sam.load_state_dict(state_dict)
107
  return sam