update torchao safetensors impl (#30155)

Signed-off-by: Angel Li <liangel@meta.com>
This commit is contained in:
liangel-02 2025-12-08 23:46:35 -05:00 committed by GitHub
parent 4c6fd25880
commit 4b03b50211
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -641,7 +641,6 @@ def safetensors_weights_iterator(
if safetensors_load_strategy == "eager":
loading_desc += " (eager)"
state_dict = {}
leftover_state_dict: dict[str, torch.Tensor] = {}
for st_file in tqdm(
@ -667,6 +666,7 @@ def safetensors_weights_iterator(
)
with safe_open(st_file, framework="pt") as f:
state_dict = {}
for name in f.keys(): # noqa: SIM118
state_dict[name] = f.get_tensor(name)