We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 05ba487 commit 8039a27Copy full SHA for 8039a27
nemo_automodel/components/checkpoint/checkpointing.py
@@ -635,7 +635,10 @@ def _do_save(
635
# PEFT saving is done on rank0 so it is a special case
636
if self.config.is_peft and is_model:
637
if not torch.distributed.is_initialized() or torch.distributed.get_rank() == 0:
638
- save_file(state_dict, os.path.join(path, "adapter_model.safetensors"))
+ # Materialize lazy mappings (e.g. LazyHFStateDict) into a plain
639
+ # dict because safetensors.save_file only accepts dict.
640
+ sd = dict(state_dict) if not isinstance(state_dict, dict) else state_dict
641
+ save_file(sd, os.path.join(path, "adapter_model.safetensors"))
642
if torch.distributed.is_initialized():
643
torch.distributed.barrier()
644
return
0 commit comments