AWS LambdaΒΆ
The security policy of AWS Lambda restricts writing outside the /tmp
directory.
To make docTR work on Lambda, you need to perform the following two steps:
Disable the usage of the
multiprocessing
package by setting theDOCTR_MULTIPROCESSING_DISABLE
environment variable toTRUE
. This step is necessary because the package uses the/dev/shm
directory for shared memory.Change the caching directory used by docTR for models. By default, it is set to
~/.cache/doctr
, which is outside the/tmp
directory on AWS Lambda. You can modify this by setting theDOCTR_CACHE_DIR
environment variable.