-
Notifications
You must be signed in to change notification settings - Fork 674
fix snapshot download behavior in offline mode when downloading to a local dir #3009
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
base: main
Are you sure you want to change the base?
Conversation
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. |
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.
From my understanding, I feel a correct fix would be to update L203 from
if commit_hash is not None:
to
if commit_hash is not None and local_dir is None:
i.e. we do the snapshot folder check only if local_dir
is not provided by the user. When local_dir
is set, the logic to handle things is a bit below (here) and returns with a warning if folder is not empty.
Co-authored-by: Lucain <lucain@huggingface.co>
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!
Should fix the incorrect behavior mentioned in this slack message (internal).
This PR addresses an issue where snapshot_download behaves incorrectly when:
local_dir
.Currently, in this scenario, we incorrectly returns the path to the cache directory instead of raising an appropriate error. This PR fixes that.