hf-hub
hf-hub copied to clipboard
🐛 hf-hub does not properly follow repo redirections with auth (after eg. renaming)
👋 Hey
This Works:
let api = ApiBuilder::from_env()
.build()
.unwrap();
let repo = api.model("meta-llama/Llama-3.1-8B".to_string());
repo.download("config.json").unwrap();
While this Fails:
let api = ApiBuilder::from_env()
.build()
.unwrap();
let repo = api.model("meta-llama/Meta-Llama-3.1-8B".to_string());
repo.download("config.json").unwrap();
called Result::unwrap() on an Err value: RequestError(Status(401, Response[status: 401, status_text: Unauthorized, url: https://huggingface.co/meta-llama/Llama-3.1-8B/resolve/main/config.json]))
In python both works as expected:
from huggingface_hub import hf_hub_download
hf_hub_download(repo_id="meta-llama/Llama-3.1-8B", filename="config.json")
hf_hub_download(repo_id="meta-llama/Meta-Llama-3.1-8B", filename="config.json")
Cheers, Daniel
can repro
Fixed https://github.com/huggingface/hf-hub/pull/110