[Bug] batchchunking not working
📦 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.
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".
I found the format of the request URL to be quite strange.
/trpc/lambda/chunk.createParseFileTask,chunk.createParseFileTask,chunk.createParseFileTask?batch=1
However, if I only click re-chunking of one file, it's successful chuncked.
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
- The failed chunck file can use batch chunking to re-embedding it.
- 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
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。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。
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:
-
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_TIMEOUTvalue in thesrc/database/server/models/asyncTask.tsfile to allow more time for the embedding process [1]. -
Concurrency and Chunk Size: Adjusting the
CHUNK_SIZEandCONCURRENCYsettings 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]. -
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].
-
Request URL Format: The format of the request URL with multiple
chunk.createParseFileTaskentries 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. -
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
It is a bug, I made a work around: https://github.com/lobehub/lobe-chat/issues/6165#issuecomment-3101341905