fix: saving clones state dict

This commit is contained in:
NanoCode012
2026-02-25 14:23:32 +07:00
parent 2b6f4a6c9b
commit 0d0122cabe

View File

@@ -725,7 +725,7 @@ class AxolotlTrainer(
state_dict = self.accelerator.get_state_dict(self.model)
if state_dict is not None:
state_dict = {
k: v.clone() if isinstance(v, torch.Tensor) else v
k: v.detach().cpu() if isinstance(v, torch.Tensor) else v
for k, v in state_dict.items()
}