Hugging Face 401 / 'Access to model ... is restricted' on gated models like Llama
@devsingh05▲ 13 net votes
Gated repos need two things: accept the licence on the model page while logged in (approval can take a while for some orgs) and authenticate the download with a token: huggingface-cli login or HF_TOKEN in the environment. A token with only read scope is enough. Being logged in on the website does not authenticate Python code. If it still fails, confirm the exact repo id you requested is the one you were approved for.