Huggingface Text Embedding Inference always fails for "big" file with the timeout error #205

Closed
opened 2026-02-16 10:18:26 -05:00 by yindo · 6 comments
Owner

Originally created by @qiulang on GitHub (Apr 17, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.1.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I have set up text-embeddings-inference using its latest cpu-1.7 image. The docker runs at the on the same machine that dify dockers run

For small files, embedding works, but if I upload a big file, say, 60k, embedding always fails with timeout error no matter how many times I tried.

Image

The timeout error

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @qiulang on GitHub (Apr 17, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.1.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I have set up [text-embeddings-inference](https://github.com/huggingface/text-embeddings-inference) using its latest cpu-1.7 image. The docker runs at the on the same machine that dify dockers run For small files, embedding works, but if I upload a big file, say, 60k, embedding always fails with timeout error no matter how many times I tried. ![Image](https://github.com/user-attachments/assets/aabb363e-65cb-48ed-be08-a71604ff6133) The timeout error ![Image](https://github.com/user-attachments/assets/50615999-90ab-40bf-9f12-2c81e0e2ff71) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-16 10:18:26 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 17, 2025):

A similar issue has been discussed in the Dify repository, where the Huggingface Text Embedding Inference fails with a timeout error when processing large files in a self-hosted Docker setup. The problem might be related to the TEXT_GENERATION_TIMEOUT_MS setting, which defaults to 60000 milliseconds (60 seconds). This timeout might not be sufficient for large files, such as 60k. Increasing this timeout value could help resolve the issue. Additionally, adjusting the GUNICORN_TIMEOUT setting to 360 seconds is recommended to support long-running connections [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 17, 2025): <!-- Answer --> A similar issue has been discussed in the Dify repository, where the Huggingface Text Embedding Inference fails with a timeout error when processing large files in a self-hosted Docker setup. The problem might be related to the `TEXT_GENERATION_TIMEOUT_MS` setting, which defaults to 60000 milliseconds (60 seconds). This timeout might not be sufficient for large files, such as 60k. Increasing this timeout value could help resolve the issue. Additionally, adjusting the `GUNICORN_TIMEOUT` setting to 360 seconds is recommended to support long-running connections <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/jp/getting-started/install-self-hosted/environments.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/744b88da-b883-4c02-a4bc-bf7d887f674c?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/744b88da-b883-4c02-a4bc-bf7d887f674c?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/744b88da-b883-4c02-a4bc-bf7d887f674c?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/744b88da-b883-4c02-a4bc-bf7d887f674c?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/744b88da-b883-4c02-a4bc-bf7d887f674c?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/744b88da-b883-4c02-a4bc-bf7d887f674c?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/744b88da-b883-4c02-a4bc-bf7d887f674c?feedback_type=other)</sup>
Author
Owner

@qiulang commented on GitHub (Apr 17, 2025):

I have increased TEXT_GENERATION_TIMEOUT_MS to 10 minutes and I start my huggingface_tei docker using --max-client-batch-size 16 --max-batch-tokens 8192

docker run -d -p 8080:80   -v /home/BAAI/bge-m3:/model   ghcr.io/huggingface/text-embeddings-inference:cpu-1.7   --model-id /model   --max-client-batch-size 16   --max-batch-tokens 8192 

But I still get the time out error

What else can I do ?

@qiulang commented on GitHub (Apr 17, 2025): I have increased TEXT_GENERATION_TIMEOUT_MS to 10 minutes and I start my huggingface_tei docker using --max-client-batch-size 16 --max-batch-tokens 8192 ``` docker run -d -p 8080:80 -v /home/BAAI/bge-m3:/model ghcr.io/huggingface/text-embeddings-inference:cpu-1.7 --model-id /model --max-client-batch-size 16 --max-batch-tokens 8192 ``` But I still get the time out error What else can I do ?
Author
Owner

@qiulang commented on GitHub (Apr 18, 2025):

I also increased GUNICORN_TIMEOUT to 600

start huggingface_tei with the default value --max-client-batch-size 32 --max-batch-tokens 16384

Same timeout error.

Upgrade dify to 1.2.0 as well.

@qiulang commented on GitHub (Apr 18, 2025): I also increased GUNICORN_TIMEOUT to 600 start huggingface_tei [with the default value](https://github.com/huggingface/text-embeddings-inference?tab=readme-ov-file#docker) --max-client-batch-size 32 --max-batch-tokens 16384 Same timeout error. Upgrade dify to 1.2.0 as well.
Author
Owner

@qiulang commented on GitHub (Apr 20, 2025):

I have tried all I can find but huggingface_tei always fails with timeout, so I switch to Xinference to server my embedding model and it works just fine. So either the dify huggingface_tei plugin has problem or huggingface_tei has problem to work with dify

@qiulang commented on GitHub (Apr 20, 2025): I have tried all I can find but huggingface_tei always fails with timeout, so I switch to Xinference to server my embedding model and it works just fine. So either the dify huggingface_tei plugin has problem or huggingface_tei has problem to work with dify
Author
Owner

@sungongwei commented on GitHub (May 17, 2025):

huggingface_tei 插件的问题,里面请求用的httpx , post请求的默认超时时间是5s,

@sungongwei commented on GitHub (May 17, 2025): huggingface_tei 插件的问题,里面请求用的httpx , post请求的默认超时时间是5s,
Author
Owner

@qiulang commented on GitHub (May 20, 2025):

我已经放弃这个改 xinference

@qiulang commented on GitHub (May 20, 2025): 我已经放弃这个改 xinference
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#205