refactor: extract triton start logic into bash function

add-more-languages
Meng Zhang 2023-04-06 10:25:50 +08:00
parent d9f09889b3
commit 4a8eee8c1f
1 changed files with 6 additions and 4 deletions

View File

@ -30,18 +30,20 @@ python -m tabby.tools.download_models --repo_id=$MODEL_NAME
} }
supervisor() { program:triton() {
if [[ "$MODEL_BACKEND" == "triton" ]] if [[ "$MODEL_BACKEND" == "triton" ]]
then then
local TRITON_SERVER=$(cat <<EOF cat <<EOF
[program:triton] [program:triton]
command=./tabby/scripts/triton.sh command=./tabby/scripts/triton.sh
EOF EOF
)
fi fi
}
supervisor() {
# Create logs dir if not exists. # Create logs dir if not exists.
mkdir -p ${LOGS_DIR} mkdir -p ${LOGS_DIR}
@ -65,7 +67,7 @@ command=dagu scheduler
[program:dagu_server] [program:dagu_server]
command=dagu server --host 0.0.0.0 --port 8080 command=dagu server --host 0.0.0.0 --port 8080
$TRITON_SERVER $(program:triton)
EOF EOF
) )
} }