Skip to content

Commit 64e5cc0

Browse files
Document that iterable train_dataset requires max_steps in RewardTrainer
1 parent 27a2bf4 commit 64e5cc0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

trl/trainer/reward_trainer.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,10 @@ class RewardTrainer(_BaseTrainer):
273273
274274
The trainer also supports processed datasets (tokenized) as long as they contain `chosen_ids` and
275275
`rejected_ids` fields.
276+
277+
When `train_dataset` is an [`~datasets.IterableDataset`] (e.g. a streaming dataset), `max_steps` must be
278+
set in the training arguments, since its length cannot be inferred and the total number of training steps
279+
is required to bound the training loop and configure the learning rate scheduler.
276280
eval_dataset ([`~datasets.Dataset`], [`~datasets.IterableDataset`], [`~datasets.DatasetDict`], [`~datasets.IterableDatasetDict`] or `dict[str, Dataset | IterableDataset]`):
277281
Dataset to use for evaluation. It must meet the same requirements as `train_dataset`.
278282
processing_class ([`~transformers.PreTrainedTokenizerBase`], *optional*):

0 commit comments

Comments
 (0)