Skip to content
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

Merged
merged 3 commits into from
Dec 13, 2023
Merged

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Dec 12, 2023

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:

With 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

@HuggingFaceDocBuilderDev

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.

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3d11c57) 82.06% compared to head (1712c8d) 82.28%.

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.
📢 Have feedback on the report? Share it here.

@julien-c
Copy link
Member

sounds like a good idea!

Copy link
Member

@LysandreJik LysandreJik left a 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!

@Wauplin
Copy link
Contributor Author

Wauplin commented Dec 13, 2023

Cool, let's get it merged then :)

@Wauplin Wauplin merged commit ed99399 into main Dec 13, 2023
16 checks passed
@Wauplin Wauplin deleted the respect-hf-hub-offline branch December 13, 2023 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants