set weight_only=False for eva_clip

This commit is contained in:
刘雪峰
2025-02-15 21:50:11 +08:00
parent 22a7030ab5
commit 7d7f6a0c36
+1 -1
View File
@@ -84,7 +84,7 @@ def load_state_dict(checkpoint_path: str, map_location: str='cpu', model_key: st
for key in ["input_resolution", "context_length", "vocab_size"]:
state_dict.pop(key, None)
else:
checkpoint = torch.load(checkpoint_path, map_location=map_location)
checkpoint = torch.load(checkpoint_path, map_location=map_location, weights_only=False)
for mk in model_key.split('|'):
if isinstance(checkpoint, dict) and mk in checkpoint:
state_dict = checkpoint[mk]