huggingface_hubThe model file
hf download: cannot locate the file on the Hub
The message
An error happened while trying to locate the file on the Hub and we cannot find the requested files in the local cache. Please check your connection and try again or make sure your Internet connection is on.
What it means
huggingface_hub could not reach the Hub and has no cached copy. It is a network failure, not a missing repo, and common from mainland China.
Why it happens
- huggingface.co is unreachable from this network: blocked, timing out, or behind a proxy the tool is not using. This is the branch the library takes when the request fails for a reason other than a missing repo, a gated repo or a bad token.
- A gated or private repo is a different message (a 401 or a gated-repo error), so this one is not a token problem.
How to fix it
- Point the library at a mirror:
export HF_ENDPOINT=https://hf-mirror.combeforehf download.HF_ENDPOINTis huggingface_hub's own setting for the Hub address; hf-mirror.com is a third-party mirror, not run by Hugging Face. The Chinese pages of this site's command generator already add it. ollama pull hf.co/…does not readHF_ENDPOINT. Download the GGUF withhf downloadthrough the mirror, then import it with a Modelfile (FROM ./file.gguf) andollama create.
Related errors
Checked against
- huggingface_hub src/huggingface_hub/file_download.py (_raise_on_head_call_error)
- huggingface_hub src/huggingface_hub/constants.py (HF_ENDPOINT)
- Ollama docs/import.mdx
Message text read from source on 2026-10-28.