-
Notifications
You must be signed in to change notification settings - Fork 441
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
Added --output-dir-use-symlinks for tune download with default as auto #816
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/816
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 41dc36f with merge base 41341fd (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Hi @apthagowda97! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
torchtune/_cli/download.py
Outdated
"--output-dir-use-symlinks", | ||
type=str, | ||
required=False, | ||
default="False", |
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.
Can we default this to 'auto' to mimic the behavior from before?
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.
If we are downloading model to --output-dir
folder. Why simply store that model in .cache
?
By selecting "auto" as default .. deletion of the model wont work properly and we need to run huggingface-cli delete-cache
to delete.
Let me know your thoughts?
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 understand your point and we can add a note about that in the documentation somewhere, but I'd like to keep the defaults the same for args that map 1:1 to Hugging Face CLI commands.
|
||
# Raise if local_dir_use_symlinks is invalid | ||
output_dir_use_symlinks: Union[Literal["auto"], bool] | ||
use_symlinks_lowercase = args.output_dir_use_symlinks.lower() |
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.
argparse
can actually handle all of this logic within the add_argument
method.
e.g.
self._parser.add_argument(
...,
choices = ["true", "false", "auto"],
)
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.
This wont work because coz.. true
and false
should be of type Boolean.
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.
It looks like they do the same thing as we do here: https://github.com/huggingface/huggingface_hub/blob/54e4f76594d2d8338ddccab566a9750cfe4da1bd/src/huggingface_hub/commands/download.py#L96. Just needs to be "True" and "False", rather than lowercase.
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.
But here the they convert to Boolean, I just used there logic https://github.com/huggingface/huggingface_hub/blob/54e4f76594d2d8338ddccab566a9750cfe4da1bd/src/huggingface_hub/commands/download.py#L137
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.
Ahh I missed that in the code, thanks for pointing it out. It's so gross, but seems like the best way to go forward.
Thanks for all your work on this @apthagowda97, I'll go ahead and merge!
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.
Left a couple comments, but overall looks good! Can you also please sign the CLA?
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. 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.
Can you install and run the linter?
Context
tune download
with default asauto
.Changelog
Test plan