support async chunking func to improve processing performance when a heavy chunking_func is passed in by user#2336
Conversation
…heavy `chunking_func` is passed in by user
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
I changed the code to a simplifier but more general implementation. Previous code could not work with object that implemented an async |
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Description
Current implementation call the
chunking_funcas synchronized function. If thechunking_funchas heavy operations such as calling LLMs, the calling will block the main loop for a long time.I add support of async implementation of
chunking_funcso that it will not block the main loop. If thechunking_funcis a normal function, the code will run as before.Related Issues
Changes Made
I simply add a condition check before calling
chunking_func. If it is an async function, call await, else call as before.lightrag.py:apipeline_process_enqueue_documents:1761
Checklist
Additional Notes
[Add any additional notes or context for the reviewer(s).]