Mention why one needs to specify max_steps in Trainer (#22333)

* Mention why one needs to specify max_steps in Trainer

* dummy change to trigger CI
This commit is contained in:
Quentin Lhoest 2023-03-23 15:26:51 +01:00 committed by GitHub
parent 5a9eb31477
commit 053c2153f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -544,7 +544,10 @@ class Trainer:
logger.info("max_steps is given, it will override any value given in num_train_epochs")
if train_dataset is not None and not has_length(train_dataset) and args.max_steps <= 0:
raise ValueError("train_dataset does not implement __len__, max_steps has to be specified")
raise ValueError(
"The train_dataset does not implement __len__, max_steps has to be specified. "
"The number of steps needs to be known in advance for the learning rate scheduler."
)
if (
train_dataset is not None