marella / chatdocs

Chat with your documents offline using AI.
MIT License
683 stars 97 forks source link

Limiting input length to prevent out of memory issues #76

Open Ciaranwuk opened 11 months ago

Ciaranwuk commented 11 months ago

If the user gives too long a prompt the GPU will throw a CUDA out of memory error and the whole PC/server requires rebooting. Does anyone have any suggestions for how to limit the length of the user input to prevent this? I believe the easiest way to do this would be to add a character limit to the input box on the UI but that wouldn't cover the CLI option, and I can't find info on how to do this.