-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
Don't push checkpoints to hub in no_trainer
scripts
#16703
Conversation
no_trainer
scripts
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.
I think we can just set the gitignore with a general pattern at its creation.
if not os.path.exists(gitignore_path): | ||
open(gitignore_path, "a").close() # Creates a .gitignore |
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.
I'd directly put here the step-*
key.
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.
Ah, yeah that would be a bit more simplistic. Thanks!
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.
Simplified it to:
with open(os.path.join(args.output_dir, ".gitignore"), 'w+') as gitignore:
if "step_*" not in gitignore:
gitignore.write("step_*\n")
if "epoch_*" not in gitignore:
gitignore.write("epoch_*\n")
Since we can have both epoch_
and step_
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.
Nice!
The documentation is not available anymore as the PR was closed or merged. |
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 working on this!
Don't push checkpoints to the Hub in
no_trainer
scriptsWhat does this add?
gitignore
file in the base folder ifpush_to_hub
was passed and one does not existsave_state
, ifpush_to_hub
was passed then then directory is added to the .gitignoreWhy is it needed?
Users shouldn't expect to have all of their checkpoints sent to both the Hub and saved locally, it should just be locally until they are ready for the final save