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

Loading from last checkpoint functionality in Trainer.train #10334

Conversation

tanmay17061
Copy link
Contributor

@tanmay17061 tanmay17061 commented Feb 22, 2021

Enhance resume_from_checkpoint argument of Trainer.train to accept
bool type. If True given, last saved checkpoint in self.args.output_dir
will be loaded. (#10280)

What does this PR do?

Please look at the feature request for full description of the changes. Thanks.
Fixes #10280

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors which may be interested in your PR.

@sgugger

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

Great addition, thanks for your work! I just have a few comments.

src/transformers/trainer.py Outdated Show resolved Hide resolved
src/transformers/trainer.py Outdated Show resolved Hide resolved
@tanmay17061 tanmay17061 force-pushed the trainer-train-load-from-last-checkpoint branch from 015374b to 8e0da8e Compare February 22, 2021 19:22
@tanmay17061 tanmay17061 requested a review from sgugger February 22, 2021 19:42
@tanmay17061
Copy link
Contributor Author

Raised changes. 1 reply to your review comment.
Do let me know if any other change required.

Thanks.

Enhance resume_from_checkpoint argument of Trainer.train to accept
bool type. If True given, last saved checkpoint in self.args.output_dir
will be loaded. (huggingface#10280)
@tanmay17061 tanmay17061 force-pushed the trainer-train-load-from-last-checkpoint branch from 8e0da8e to 41fb7cd Compare February 22, 2021 20:02
@tanmay17061 tanmay17061 requested a review from sgugger February 22, 2021 20:21
@sgugger sgugger merged commit 94d8767 into huggingface:master Feb 22, 2021
@sgugger
Copy link
Collaborator

sgugger commented Feb 22, 2021

Thanks a lot for your contribution!

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.

Trainer.train argument resume_from_last_checkpoint
2 participants