lobe-chat icon indicating copy to clipboard operation
lobe-chat copied to clipboard

[Bug] batchchunking not working

Open trganda opened this issue 1 year ago • 2 comments

📦 Platform

Vercel

📦 Deploymenet mode

server db(lobe-chat-database image)

📌 Version

v1.63.3

💻 Operating System

Ubuntu

🌐 Browser

Chrome

🐛 Bug Description

I' have deployed the lobe-chat with vercel, and everything working as expect.

When I'm trying to upload multi files and batch chunking it (about 1000+), some file are failed to chunk.

Image

I think it may be due to the limited processing capacity of the Ollama service that I deployed myself. Then I'm try to select 3 file and re-batch chunking it, I'm still got error "chunking task is timeout, please try again".

Image

I found the format of the request URL to be quite strange.

/trpc/lambda/chunk.createParseFileTask,chunk.createParseFileTask,chunk.createParseFileTask?batch=1
Image

However, if I only click re-chunking of one file, it's successful chuncked.

Image

If you need more information, please let me know.

📷 Recurrence Steps

1、Deploy lobe-chat with vercel, and using a self deployed ollama server as embedding server. 2、Create a knownledage base, and upload batch file (about 1000+), use batch-chunking to chunk them all.

🚦 Expected Behavior

  1. The failed chunck file can use batch chunking to re-embedding it.
  2. The request url to the batch chunking of backend should not have multi chunk.createParseFileTask

📝 Additional Information

I'm using a self-deploy ollama to support embedding, and I'm sure it's working.

Before using the lobe-chat, I'm also tried to using anythingllm to embedding mult file (1000+) with my ollama server, and it's work as expected.

trganda avatar Feb 24 '25 07:02 trganda

👀 @trganda

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

lobehubbot avatar Feb 24 '25 07:02 lobehubbot

Hey there, @trganda! I'm here to help you with any bugs, questions, or contributions. Let's tackle this issue together!

The issue you're experiencing with batch chunking in lobe-chat could be related to several factors:

  1. Timeout Error: The "chunking task is timeout" error suggests that the embedding task is exceeding the allowed processing time. You can try increasing the ASYNC_TASK_TIMEOUT value in the src/database/server/models/asyncTask.ts file to allow more time for the embedding process [1].

  2. Concurrency and Chunk Size: Adjusting the CHUNK_SIZE and CONCURRENCY settings might help manage the load better. Increasing these values can allow more data to be processed in each batch and more batches to be processed simultaneously, but be cautious of the system's capacity [2].

  3. Ollama Service Configuration: Ensure that your Ollama service is correctly configured for cross-origin access and is capable of handling the load. You might need to verify the environment variables and settings for Ollama, as detailed in the configuration steps [3].

  4. Request URL Format: The format of the request URL with multiple chunk.createParseFileTask entries might indicate an issue with how batch requests are being constructed or processed. This could be a bug in the system that needs further investigation.

  5. Retry Mechanism: If some files fail to chunk, consider implementing a retry mechanism to handle transient errors or failures in the embedding process.

If these adjustments do not resolve the issue, further investigation into the specific configuration and deployment setup might be necessary.

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] avatar Feb 24 '25 08:02 dosubot[bot]

It is a bug, I made a work around: https://github.com/lobehub/lobe-chat/issues/6165#issuecomment-3101341905

livdelic avatar Jul 22 '25 08:07 livdelic