Skip to content

Commit 46a8f22

Browse files
JaktensTidNosimusAI
authored andcommitted
fix: prevent second save in the end of training
1 parent 7aca13e commit 46a8f22

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/transformers/trainer_callback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ def on_step_end(self, args: TrainingArguments, state: TrainerState, control: Tra
604604
if state.global_step >= state.max_steps:
605605
control.should_training_stop = True
606606
# Save the model at the end if we have a save strategy
607-
if args.save_strategy not in [SaveStrategy.NO, SaveStrategy.BEST, SaveStrategy.STEPS]:
607+
if args.save_strategy == SaveStrategy.STEPS:
608608
control.should_save = True
609609

610610
return control

0 commit comments

Comments
 (0)