Skip to content

Commit af000ce

Browse files
winglianSunMarc
andauthored
Fix load of rng state for resuming training from checkpoint (#37162)
Co-authored-by: Marc Sun <[email protected]>
1 parent 0af0a5f commit af000ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/transformers/trainer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3122,7 +3122,7 @@ def _load_rng_state(self, checkpoint):
31223122
return
31233123

31243124
with safe_globals():
3125-
checkpoint_rng_state = torch.load(rng_file, weights_only=True)
3125+
checkpoint_rng_state = torch.load(rng_file)
31263126
random.setstate(checkpoint_rng_state["python"])
31273127
np.random.set_state(checkpoint_rng_state["numpy"])
31283128
torch.random.set_rng_state(checkpoint_rng_state["cpu"])

0 commit comments

Comments
 (0)