-
Notifications
You must be signed in to change notification settings - Fork 31.3k
fix: prevent second save in the end of training if last step was saved already #36219
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
fix: prevent second save in the end of training if last step was saved already #36219
Conversation
SunMarc
left a comment
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.
LGTM !
|
Hi, these tests are flicking. Can we restart pipeline? |
a03067b to
46a8f22
Compare
|
@shethaadit @SunMarc can you merge? It says that 2 workflows awaiting approval, but they are completed. |
|
just waiting a last review |
|
Could you also try to add a test to this, that would be nice |
muellerzr
left a comment
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.
Thanks for the fix, all green from me after we add a test please!
|
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. |
|
@SunMarc @muellerzr @shethaadit could you approve pls. Added unit test. |
SunMarc
left a comment
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.
Thanks a lot !
* ci: try to fix test-full also use 3.12 to run full tests * fix mypy errors * hf: fix deprecated arguments in transformers.TrainingArguments * tests: adjust assertions in test_huggingface_log_model Due to huggingface/transformers#36219.
What does this PR do?
Fixes # (issue)
To resolve the issue where the model is saved twice when using save_strategy="epoch", we need to prevent the redundant save at the end of training. The save triggered by the end of the last epoch is sufficient, so we skip the final save when the strategy is set to epoch.
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
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.