-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 offline mode when loading pipeline #6456
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.
🫶
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. |
Thanks for the review :) |
Broke my build with error: cannot import name 'OfflineModeIsEnabled' from 'huggingface_hub.utils' (/opt/conda/lib/python3.8/site-packages/huggingface_hub/utils/init.py) Was working fine before the commit |
perhaps because im running huggingface_hub-0.19.4 instead of 0.20.1? |
* Respect offline mode when loading model * default to local entry if connectionerror
* Respect offline mode when loading model * default to local entry if connectionerror
Should close #6168.
This PR adds two behaviors:
HF_HUB_OFFLINE=1
), we catch the error raised byhuggingface_hub
and default back to using the local files.In both cases, if local files don't exist an error will be raised later in the code (as we can't load the pipeline).
This PR should definitely settle the problems for users with slow/low connections. cc @sayakpaul with whom we discussed it at some point.