-
Notifications
You must be signed in to change notification settings - Fork 601
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
Respect HF_HUB_OFFLINE for every http call #1899
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. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1899 +/- ##
==========================================
+ Coverage 82.06% 82.28% +0.21%
==========================================
Files 65 65
Lines 8030 8032 +2
==========================================
+ Hits 6590 6609 +19
+ Misses 1440 1423 -17 ☔ View full report in Codecov by Sentry. |
sounds like a good idea! |
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.
Yes, 💯 ! Makes sense to me!
Cool, let's get it merged then :) |
At the moment
HF_HUB_OFFLINE
is only respected when downloading files. This PR makes it used globally for any call to the Hub.Not respecting it makes it harder to debug things in some cases. For example:
snapshot_download
should not make the HTTP call to list the repo filesdiffusers
should not make amodel_info
call => see Loading LORA weights withload_lora_weights
do not respectHF_HUB_OFFLINE
/local_file_only
diffusers#6089 which would have been easier to investigateWith this PR, any unintended call to the Hub will raise a
OfflineModeIsEnabled
error. Either the dependent libraries chose to catch it explicitly and default back to another solution or the user gets an explicit error -which is easier when reporting an issue.cc @sayakpaul as well