-
Notifications
You must be signed in to change notification settings - Fork 1.9k
📋 Allow calling trl cli in sft mode with config file #3380
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
Conversation
trl/cli.py
Outdated
args = parser.parse_args_and_config()[0] | ||
else: | ||
# Parse the arguments normally if no config file is specified | ||
args = parser.parse_args() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should check here that dataset_name
is in args? I needed to make dataset_name
optional so that a call to parser.parse_args()
works in the cases further down, checking that args contains dataset_name
will then make sure that the same checks are in place as without this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should check here that dataset_name is in args
if you don't provide the dataset, it would fail when trying to load it in the sft script. I think the error will be pretty self-explanatory, no need to add an extra check in my opinion.
Thanks, your solution is very good, I simplified the test a bit, and the parsing logic, and once the tests are green, we can merge 🎉 |
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 thanks for the review and improving the PR. Pipelines are passing ;) |
What does this PR do?
This PR makes it possible to specify all required arguments in a config.yaml file and call this via cli, e.g.
This line is directly from the trl docs but didn't work since
config
is no known argument of theTrlParser
when callingparse_args
which is always called.Fixes #3102
Before submitting
Pull Request section?
to it if that's the case.
[ ] Did you make sure to update the documentation with your changes?Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.