diff --git a/docs/configuration.md b/docs/configuration.md index bbe46f4de..c2bcb12e9 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -288,6 +288,12 @@ this folder is no longer needed and can be removed manually. Defaults to `/usr/share/nltk_data` +#### [`PAPERLESS_MODEL_FILE=`](#PAPERLESS_MODEL_FILE) {#PAPERLESS_MODEL_FILE} + +: This is where paperless will store the classification model. + + Defaults to `PAPERLESS_DATA_DIR/classification_model.pickle`. + ## Logging #### [`PAPERLESS_LOGROTATE_MAX_SIZE=`](#PAPERLESS_LOGROTATE_MAX_SIZE) {#PAPERLESS_LOGROTATE_MAX_SIZE} diff --git a/src/paperless/settings.py b/src/paperless/settings.py index 831e4e953..c4e70f68a 100644 --- a/src/paperless/settings.py +++ b/src/paperless/settings.py @@ -256,7 +256,10 @@ TRASH_DIR = os.getenv("PAPERLESS_TRASH_DIR") # threads. MEDIA_LOCK = MEDIA_ROOT / "media.lock" INDEX_DIR = DATA_DIR / "index" -MODEL_FILE = DATA_DIR / "classification_model.pickle" +MODEL_FILE = __get_path( + "PAPERLESS_MODEL_FILE", + DATA_DIR / "classification_model.pickle", +) LOGGING_DIR = __get_path("PAPERLESS_LOGGING_DIR", DATA_DIR / "log")