Remove custom get_train/eval_dataloader from OnlineDPO#5291
Merged
albertvillanova merged 2 commits intohuggingface:mainfrom Mar 16, 2026
Merged
Remove custom get_train/eval_dataloader from OnlineDPO#5291albertvillanova merged 2 commits intohuggingface:mainfrom
albertvillanova merged 2 commits intohuggingface:mainfrom
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
qgallouedec
approved these changes
Mar 16, 2026
Member
qgallouedec
left a comment
There was a problem hiding this comment.
Thanks, I think it makes sense. I'm not even sure that online dpo works with remove_unused_columns=True. If we decide to refactor it in the future we should aim to something closer to GRPO where this feature is properly supported
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove custom get_train/eval_dataloader from OnlineDPO,
This PR updates the configuration and trainer logic for Online DPO implementation by adding a new configuration option default (
remove_unused_columns=False), and removing custom dataloader methods to simplify the codebase.Note that
transformers.Trainer.get_train_dataloader(andget_eval_dataloader) support skipping the removal of unused columns by settingargs.remove_unused_columns=Falsesince v4.54.1 and we support >=4.56.2:Trainertransformers#17166Related to:
Changes
Configuration improvements:
remove_unused_columnsoption toOnlineDPOConfig, defaulting toFalseinstead of the previous default ofTrue, and updated the documentation to reflect this change.Codebase simplification:
get_train_dataloaderandget_eval_dataloaderfromOnlineDPOTrainer, which previously skipped theremove_unused_columnslogic, reverting to the standard Trainer behavior.online_dpo_trainer.pyby removing unused or redundant imports, includingwraps,Trainer,seed_worker, andDataLoader.Note
Medium Risk
Changes Online DPO’s dataloader behavior by relying on
transformers.Trainerwithremove_unused_columns=False, which may affect training/eval if downstream datasets previously depended on column stripping or the prior custom loader behavior.Overview
Online DPO now defaults to keeping all dataset columns by adding
remove_unused_columns=FalsetoOnlineDPOConfig(and documenting the overridden default).OnlineDPOTrainerdrops its customget_train_dataloader/get_eval_dataloaderoverrides that existed solely to bypass unused-column removal, and cleans up the related now-unused imports—delegating dataloader construction back totransformers.Trainer.Written by Cursor Bugbot for commit d9bce4c. This will update automatically on new commits. Configure here.