Fix: missing else branch to handle "--load_best_model_at_end" in training_args.py (#38217)

Update training_args.py
This commit is contained in:
danielyxyang 2025-05-21 16:28:56 +02:00 committed by GitHub
parent ae3e4e2d97
commit d6c34cdcd0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1646,10 +1646,11 @@ class TrainingArguments:
"--load_best_model_at_end requires the saving steps to be a multiple of the evaluation "
f"steps, but found {self.save_steps}, which is not a multiple of {self.eval_steps}."
)
raise ValueError(
"--load_best_model_at_end requires the saving steps to be a round multiple of the evaluation "
f"steps, but found {self.save_steps}, which is not a round multiple of {self.eval_steps}."
)
else:
raise ValueError(
"--load_best_model_at_end requires the saving steps to be a round multiple of the evaluation "
f"steps, but found {self.save_steps}, which is not a round multiple of {self.eval_steps}."
)
safetensors_available = is_safetensors_available()
if self.save_safetensors and not safetensors_available: