-
Notifications
You must be signed in to change notification settings - Fork 20
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
Ollama does not seem to be able to process long documents #56
Comments
Yeah that's an issue I already address in the next update. Stay tuned. Sorry for the inconvenience. |
But you have to also increase that parameter in Ollama itself. |
this value is hard-coded to 10000 in https://github.com/clusterzx/paperless-ai/blob/main/services/ollamaService.js on lines 40 and 109. |
Also, would it be possible to move the num_ctx to a UI setting or env variable rather than hard-coding it into ollamaService.js? I wasn't sure if this was one of the updates you already have in the works or not |
Also, lol, just had my 40,000 one get cut off because of the prompt being 91631... |
Describe the bug
I have Paperless-AI set up and working with a local Paperless-ngx and local Ollama. The instance successfully processes and tags short documents. However, the Paperless-AI instance silently fails on long documents.
I believe that Paperless-AI is sending Ollama too long of a prompt and the prompt is being truncated.
Looking at the logs for Paperless-AI, I see the following:
Looking at the Ollama logs, I only see the following:
When I look at the network request via the browser console after pressing the "Analyze with AI" button at the
/manual
route, I see this empty object as the network response:It looks like it might be necessary for Paperless-AI to specify the
num_ctx
parameter as part of its Ollama-based requests: https://github.com/ollama/ollama/blob/main/docs/faq.md#how-can-i-specify-the-context-window-sizeThe text was updated successfully, but these errors were encountered: