-
Notifications
You must be signed in to change notification settings - Fork 555
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
Improve snapshot_download
offline mode
#1913
Conversation
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!
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.
Looks awesome! Just left a comment regarding an error I don't understand completely.
LGTM
…uggingface/huggingface_hub into improve-snapshot-download-offline-mode
Thanks for the thorough review! I've updated the error message that was wrong. I'll wait for the CI to complete and merge it to include it in next release :) |
Failing test is unrelated. Let's get it merged! |
Follow-up after #1899 and huggingface/diffusers#6168 (comment).
At the moment if
snapshot_download
fails because of a connection error, because repo not found, because Hub is down, etc., we do not try to locate the cached snapshot directory. This is not consistent with 1. what happens inhf_hub_download
and 2. what happens insnapshot_download
itself if local_files_only/HF_HUB_OFFLINE is set. This PR fixes this by adapting the existing workflow ofhf_hub_download
tosnapshot_download
. It should helpdiffusers
users that have an unstable connection to load their weights when already cached.Note: it should help but once this is shipped we would still need to adapt
diffusers
implementation as well. At the moment diffusers make at least amodel_info
to check file names (if I remember correctly). This call would have to handle theOfflineModeIsEnabled
error as well.