Kapi3
August 24, 2024, 4:51pm
1
I have validated the token with the
huggingface_hub.login(“xxx”) (this works: Login successful)
strong textrepoid=“meta-llama/Meta-Llama-3.1-8B”
*HuggingFaceEndpoint (repo_id=repoid, token=“xxx”)
I get the error
Could not authenticate with huggingface_hub. Please check your API token. (type=value_error)
I have tried multiple times with new tokens.
hi @Kapi3
It seems you use langchain. I don’t know whether this might help or not:
opened 09:51AM - 03 Jul 24 UTC
🤖:bug
### Checked other resources
- [X] I added a very descriptive title to this issu… e.
- [X] I searched the LangChain documentation with the integrated search.
- [X] I used the GitHub search to find a similar question and didn't find it.
- [X] I am sure that this is a bug in LangChain rather than my code.
- [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
### Example Code
```python
from langchain_community.llms import HuggingFaceEndpoint
llm = HuggingFaceEndpoint(endpoint_url="https://mixtral.ai.me", huggingfacehub_api_token=<token>)
### Error Message and Stack Trace (if applicable)
(can't paste because this issue is from an airgapped environment)
```
File /usr/local/lib/python3.10/dist-packages/pydantic/v1/main.py:341, in BaseModel.__init__
ValidationError: 1 validation error for HuggingFaceEndpoint
__root__
Could not authenticate with huggingface_hub. Please check your API token. (type=value_error)
```
### Description
I am trying to use HuggingFaceEndpoint in order to query my locally hosted mixtral. I have a proxy before the proxy that accepts Bearer API tokens. The tokens and API works in other places (e.g. postman) but not with langchain.
### System Info
langchain==0.2.6
langchain-community==0.0.38
langchain-core==0.1.52
langchain-text-splitters==0.2.2
platform: Ubuntu 22.04
Python version: 3.10.12
The runtime is actually Nvidia's Pytorch container from the NGC catalog, tag 24.01.
The environment is airgapped, and we go through a pipeline in order to bring in new library versions.
If not please share your script and library version.