Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SFT] add SFT Trainer Config dataclass #1530

Merged
merged 15 commits into from
Apr 23, 2024
Merged

Conversation

kashif
Copy link
Collaborator

@kashif kashif commented Apr 12, 2024

Add a SFTConfig training argument dataclass together with deprecation warnings to the SFTTrainer

@kashif kashif marked this pull request as draft April 12, 2024 12:57
@HuggingFaceDocBuilderDev

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.

@kashif kashif changed the title [SFT] add SFT Config [SFT] add SFT Trainer Config dataclass Apr 12, 2024
@kashif kashif marked this pull request as ready for review April 15, 2024 10:21
@kashif kashif requested review from lvwerra and removed request for lewtun April 18, 2024 11:01
Copy link
Member

@lewtun lewtun left a comment

Choose a reason for hiding this comment

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

Thanks a lot for adding this config @kashif ! LGTM apart from some nits.

Given this is the most used trainer in the lib, would you mind adding a small backwards compatibility integration test where we init the trainer in two ways (setting all args we deprecated in the init) and then checking the results after 1 train step are the same?

examples/scripts/sft.py Outdated Show resolved Hide resolved
examples/scripts/sft.py Outdated Show resolved Hide resolved
examples/scripts/sft.py Outdated Show resolved Hide resolved
tests/test_sft_trainer.py Outdated Show resolved Hide resolved
tests/test_sft_trainer.py Show resolved Hide resolved
trl/trainer/sft_config.py Outdated Show resolved Hide resolved
trl/trainer/sft_trainer.py Outdated Show resolved Hide resolved
Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

Thank you so much ! In addition to @lewtun comments i have two tiny comments, WDYT?

trl/trainer/sft_config.py Outdated Show resolved Hide resolved
trl/trainer/sft_trainer.py Show resolved Hide resolved
Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

Looking great thanks ! failing test is unrelated to this PR: https://github.com/huggingface/trl/actions/runs/8786654281/job/24110021581?pr=1530

trl/commands/cli_utils.py Outdated Show resolved Hide resolved
Copy link
Member

@lewtun lewtun left a comment

Choose a reason for hiding this comment

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

Looks great, with a minor nit on the dataset split names. Feel free to merge after fixing that!

trl/commands/cli_utils.py Outdated Show resolved Hide resolved
@kashif kashif merged commit f30daa4 into huggingface:main Apr 23, 2024
9 checks passed
@kashif kashif deleted the sft-config branch April 23, 2024 10:12
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.

5 participants