Account Issue: Persistent 401 Unauthorized Error on All Downloads

Web browsers manage their own environments in complex ways behind the scenes, so it is best to think of them as separate environments from CLI. However, the fact that you can download files using a web browser suggests that this is not intentionally blocked.

Some errors can be identified immediately by their error code, but I think the causes of 401 errors are the most diverse on Hugging Face in terms of error code…:cold_face:
It could be a network issue, or it could be a case where the keyboard shortcut ctrl+v (ctrl+p on Mac) for copying and pasting is malfunctioning. There also seem to be cases where caches such as .netrc are causing problems.

In your case, “Invalid token” means that the server understands that you are trying to pass a token, but the content does not look like a token.
Personally, if the token doesn’t work even when hardcoded in the Python code, I think there might be an unknown bug. @Wauplin

1 Like