Skip to content

📤 Fix a dataset loading bug in scripts#4124

Merged
qgallouedec merged 2 commits into
huggingface:mainfrom
singing-cat:fix-sft-example-bug
Sep 23, 2025
Merged

📤 Fix a dataset loading bug in scripts#4124
qgallouedec merged 2 commits into
huggingface:mainfrom
singing-cat:fix-sft-example-bug

Conversation

@singing-cat

Copy link
Copy Markdown
Contributor

What does this PR do?

In official sft script example trl/scripts/sft.py, line 126, I believe there is a tiny mistake here. If dataset_args.datasets and script_args.dataset_name both exist, according to the warning info, we should use datasets argument to load the dataset. Therefore, we need to add dataset = get_dataset(dataset_args) after this if branch. Otherwise, if user provides both dataset_args.datasets and script_args.dataset_name, this script will error.

@qgallouedec qgallouedec left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

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 qgallouedec changed the title Fix a bug in sft example. Fix a dataset loading bug in scripts Sep 23, 2025
@qgallouedec qgallouedec changed the title Fix a dataset loading bug in scripts 📤 Fix a dataset loading bug in scripts Sep 23, 2025
@qgallouedec qgallouedec merged commit e8ba9ea into huggingface:main Sep 23, 2025
qgallouedec added a commit that referenced this pull request Sep 23, 2025
Co-authored-by: Quentin Gallouédec <gallouedec.quentin@gmail.com>
qgallouedec added a commit that referenced this pull request Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants