-
Notifications
You must be signed in to change notification settings - Fork 69
Tesseract spawning 3 threads, no matter how many CPU cores system has #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Even worse, |
Hi, yes, thanks for letting me know! This is exactly why I appreciate feedback—it's such a small oversight, but an important one. I've just applied the new implementation, which is now in the pull request. I should be merging it for the next release, v0.1.33, which will be out tomorrow or the day after. Let me know what you think. This implementation includes several optimizations:Parallel PDF Processing:
Parallel OCR Processing:
Memory Management:
Error Handling:
This implementation should significantly speed up OCR processing on multi-core machines while optimizing memory usage. |
@DonTizi awesome, look forward to trying this out. I've been running a |
@DonTizi is there a way to specify
|
I’ll add it tonight. I see that you have a large knowledge base—if that’s correct, can I ask how many documents you’re trying to feed? Also, which LLM will you be using? I’m currently working on a robust vector store to optimize performance for large knowledge bases, and discovering its current weaknesses would greatly help me with your use case! You can leave your feedback here or at rmelbouci@rlama.dev—it would be greatly appreciated! |
@DonTizi total documents is 2,182 pdfs and 6 GB total in size. LLM is |
Ok, I recommend playing around with the context size when running your RAG using --context-size=xx. Smaller models (below 32B) struggle with a context size of 20 and above. Try testing with a range of 5 to 15 to see how it impacts performance. In the version I’m working on, I’m trying to implement agentic RAG to retrieve the best contexts without having multiple ones for smaller LLMs. |
It looks like the OCR
tesseract
is only spawning 3 threads, when my machine has 8 cores. Is this an optimization that can be made to spawnn(cores) + 1
threads/processes oftesseract
when creating a new RAG?The text was updated successfully, but these errors were encountered: