A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Ensure `OCR_THREADS` is integer, add documentation
Pit Kleyersburg20b2408dbbbb
diff --git a/docs/setup.rst b/docs/setup.rstindex 1ca9a6ed3..24a9b9fa2 100644--- a/docs/setup.rst+++ b/docs/setup.rst@@ -58,6 +58,11 @@ Standard (Bare Metal)passphrase from the environment, so if you don't set it to a static valuehere, you must set ``PAPERLESS_PASSPHRASE=some-secret-string`` on thecommand line whenever invoking the consumer or webserver.+ * ``OCR_THREADS``: this is the number of threads the OCR process will spawn+ to process document pages in parallel. The default value gets sourced from+ the environment-variable ``PAPERLESS_OCR_THREADS`` and expects it to be an+ integer. If the variable is not set, Python determines the core-count of+ your CPU and uses that value.4. Initialise the database with ``./manage.py migrate``.5. Create a user for your Paperless instance with``./manage.py createsuperuser``. Follow the prompts to create your user.diff --git a/src/documents/consumer.py b/src/documents/consumer.pyindex 3f3b9e9a3..2fa0ea016 100644--- a/src/documents/consumer.py+++ b/src/documents/consumer.py@@ -52,7 +52,7 @@ class Consumer(Renderable):SCRATCH = settings.SCRATCH_DIRCONVERT = settings.CONVERT_BINARYCONSUME = settings.CONSUMPTION_DIR- THREADS = settings.OCR_THREADS+ THREADS = int(settings.OCR_THREADS) if settings.OCR_THREADS else NoneOCR = pyocr.get_available_tools()[0]DEFAULT_OCR_LANGUAGE = settings.OCR_LANGUAGE