From 1edfba77c94d77246595d684c501da3abb8b1ccc Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 30 Jun 2022 21:15:45 -0500 Subject: [PATCH] gunicorn: don't use shared memory for model. This didn't seem to be necessary, and it made running in Docker more difficult since you have to use --shm-size=1G to raise the shared memory limit. --- app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index a66bb0a..ca578da 100755 --- a/app.py +++ b/app.py @@ -15,8 +15,8 @@ autotagger = Autotagger(model_path) # This is necessary for Gunicorn to work with multiple workers and preloading enabled. torch.set_num_threads(1) -autotagger.learn.model.eval() -autotagger.learn.model.share_memory() +#autotagger.learn.model.eval() +#autotagger.learn.model.share_memory() app = Flask(__name__) app.config["JSON_SORT_KEYS"] = False