Replies: 3 comments
-
|
Hi @qhu009! I'm Dosu and I’m helping the ragflow team. This 401 error is likely because RAGFlow’s HuggingFaceEmbed integration does not include an Authorization header with your Hugging Face token when making API requests, even though the token works in Postman. The code only sets Content-Type and assumes a local or proxy endpoint, not the cloud API, so authentication headers are missing by default (source). There are also known issues with custom embedding model support in RAGFlow v0.19.0—custom models often don’t work as expected, and the recommended workaround is to use the default built-in embedding model ( If you need to use a Hugging Face-hosted model directly, you would have to modify the HuggingFaceEmbed class to add an Authorization header with your token, like this: headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {your_token}'
}and pass these headers in the requests. Alternatively, switching to the full (non-slim) RAGFlow Docker image and using the default supported embedding model is the most reliable path for now. Let me know if you want more details on modifying the code or configuring the model registration. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
@asiroliu for double check |
Beta Was this translation helpful? Give feedback.
-
|
@qhu009 Currently, only version v0.19.0 is affected. You have two options to resolve this:
For production environments, we recommend directly modifying the code instead of using the nightly build, as it hasn't undergone comprehensive testing.
|
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Hi Hugging Face Support Team,
I'm currently using RAGFlow v0.19.0 (slim version) running from a local Docker image. When I try to add the embedding model BAAI/bge-base-zh-v1.5, I encounter the following error:
“Fail to access embedding model (BAAI/bge-base-zh-v1.5). Error: 401 - {"error":"Invalid username or password."}"
To verify whether this is an issue with my access token, I tested the same token separately using Postman, sending a request to the Hugging Face Inference API. The response was successful (200 OK), and I was able to retrieve valid results from the model.
This suggests that the token itself is valid and has the correct permissions (including read and inference scopes). However, RAGFlow still fails to connect with a 401 error.
Could you please help investigate whether this is related to how RAGFlow communicates with the API, or whether there are any known compatibility issues or required headers that RAGFlow might be missing?
Thanks a lot for your assistance.
Best regards,
Beta Was this translation helpful? Give feedback.
All reactions