Skip to content

Commit 4e5921f

Browse files
run uwsgi in --lazy-apps mode to avoid SentenceTransformer warning
> huggingface/tokenizers: The current process just got forked, after > parallelism has already been used. Disabling parallelism to avoid deadlocks This mode instructs uWSGI to load the application one time per worker, and will therefore prevent forking a process after SentenceTransformer has been initialized. See https://uwsgi-docs.readthedocs.io/en/latest/articles/TheArtOfGracefulReloading.html#preforking-vs-lazy-apps-vs-lazy
1 parent 257adbe commit 4e5921f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ RUN python test_intercom.py
4949
ENV FLASK_APP=app.py
5050

5151
# Run the application using uWSGI
52-
CMD ["uwsgi", "--http", "0.0.0.0:5050", "--wsgi-file", "app.py", "--callable", "app", "--processes", "4", "--threads", "2"]
52+
CMD ["uwsgi", "--lazy-apps", "--http", "0.0.0.0:5050", "--wsgi-file", "app.py", "--callable", "app", "--processes", "4", "--threads", "2"]

0 commit comments

Comments
 (0)