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

Fixed an error when finding a model name in the repository while offline #135

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

fallingmeteorite
Copy link

When I enable offline mode, "_models[model_name] = open_onnx_model(hf_hub_download())“ in the “_open_model” function looks for the model locally and returns the path,

But “_check_model_name()” is directed to access to the hf repository, which is not possible in the offline state,

This results in offline users having a model that is locally present and unusable.

Now if there is no cache model locally and HF_HUB_OFFLINE=1 is enabled, an exception will be thrown as: You have turned on environment variables, HF_HUB_OFFLINE=1, but there are no cache files locally, please unset HF_HUB_OFFLINE=1 and enable it after downloading the model

There will be no problems with normal use, and when the model is cached locally, using HF_HUB_OFFLINE=1 will work normally

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.

1 participant