mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 12:24:53 +00:00
Force weights_only (before fully breaking pickle files anyway).
This commit is contained in:
parent
f9958ee191
commit
422f23be74
@ -68,7 +68,7 @@ def convert_file(pt_file: Path, sf_file: Path, discard_names: List[str]):
|
||||
Forcing us to check for potentially different keys during load when looking
|
||||
for specific tensors (making tensor sharing explicit).
|
||||
"""
|
||||
loaded = torch.load(pt_file, map_location="cpu")
|
||||
loaded = torch.load(pt_file, map_location="cpu", weights_only=True)
|
||||
if "state_dict" in loaded:
|
||||
loaded = loaded["state_dict"]
|
||||
to_removes = _remove_duplicate_names(loaded, discard_names=discard_names)
|
||||
|
Loading…
Reference in New Issue
Block a user