# API Token not being recognized

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fapi-token-not-being-recognized%2F156624%3E%5C
**Category:** Beginners\
**Created:** [May 24, 2025, 2:14pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fapi-token-not-being-recognized%2F156624 "2025-05-24T14:14:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [May 24, 2025, 11:08pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fapi-token-not-being-recognized%2F156624%2F2 "2025-05-24T23:08:08Z")

</div>

401 errors are usually caused by network errors or environment variables, but there seem to be rare cases like this.

> [@401 Error when trying to upload model from local machine](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2F401-error-when-trying-to-upload-model-from-local-machine%2F156020)%3A
>
> Hello everyone, im currently training LLMs locally with the Unsloth framework. After training they provide a way to upload your model to the Huggingface Hub. model.push\_to\_hub\_gguf( “LuuWee/modelspacename”, # Change hf to your username! tokenizer, quantization\_method = [“q4\_k\_m”, “q8\_0”, “q5\_k\_m”,], token = “hf\_access\_token”, ) For it to upload you need to add your username and an Accesstoken in the request. This worked for me when i trained in Google Colab. I tried the same thing in my …

> [@Huggingface-cli login issue](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhuggingface-cli-login-issue%2F136547%2F3)%3A
>
> i seemed to have in ~/.netrc credentials for [huggingface.co](http://huggingface.co), which i think they might have overridden my Authorization header. a smiple rm ~/.netrc did the trick

> i seemed to have in `~/.netrc` credentials for [huggingface.co](http://huggingface.co), which i think they might have overridden my Authorization header.  
> a smiple `rm ~/.netrc` did the trick

---

_[View the full topic](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fapi-token-not-being-recognized%2F156624)._
