From 962f4b53b5311e61c3b5481086fbbb514ccbd256 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Tue, 4 Apr 2023 11:54:57 +0800 Subject: [PATCH] feat: set WEB_CONCURRENCY to number of CPU cores --- deployment/scripts/tabby.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deployment/scripts/tabby.sh b/deployment/scripts/tabby.sh index 908a910..9810290 100755 --- a/deployment/scripts/tabby.sh +++ b/deployment/scripts/tabby.sh @@ -9,6 +9,10 @@ export CONFIG_FILE=${CONFIG_FILE:-/data/config/tabby.toml} # server export MODEL_NAME="${MODEL_NAME:-TabbyML/J-350M}" export MODEL_BACKEND="${MODEL_BACKEND:-python}" +if [ ! -n "$WEB_CONCURRENCY" ]; then + # Set WEB_CONCURRENCY for uvicorn workers. + export WEB_CONCURRENCY=$(nproc --all) +fi # projects export GIT_REPOSITORIES_DIR="${REPOSITORIES_DIR:-/data/repositories}"