chore: fix run.sh for stt deployment
stt 경로/conda ncue 환경을 사용하고, 배포 기본값으로 --reload를 끄며 PORT/RELOAD 환경변수로 실행 옵션을 제어합니다. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
14
run.sh
14
run.sh
@@ -1,13 +1,16 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
cd /home/dsyoon/workspace/tts
|
cd /home/dsyoon/workspace/stt
|
||||||
|
|
||||||
CONDA_BASE="/home/dsyoon/workspace/miniconda3"
|
CONDA_BASE="/home/dsyoon/workspace/miniconda3"
|
||||||
source "${CONDA_BASE}/bin/activate" tts
|
source "${CONDA_BASE}/bin/activate" ncue
|
||||||
|
|
||||||
|
# Torch/ctranslate2 런타임 로딩에 conda lib 경로 필요할 수 있음
|
||||||
export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH:-}"
|
export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH:-}"
|
||||||
|
|
||||||
PORT="${PORT:-8025}"
|
PORT="${PORT:-8025}"
|
||||||
|
RELOAD="${RELOAD:-0}"
|
||||||
|
|
||||||
if lsof -ti tcp:"${PORT}" >/dev/null 2>&1; then
|
if lsof -ti tcp:"${PORT}" >/dev/null 2>&1; then
|
||||||
echo "Stopping existing server on port ${PORT}..."
|
echo "Stopping existing server on port ${PORT}..."
|
||||||
@@ -15,5 +18,10 @@ if lsof -ti tcp:"${PORT}" >/dev/null 2>&1; then
|
|||||||
sleep 1
|
sleep 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
nohup uvicorn app.main:app --reload --host 127.0.0.1 --port 8025 > server.log &
|
UVICORN_ARGS=("--host" "127.0.0.1" "--port" "${PORT}")
|
||||||
|
if [[ "${RELOAD}" == "1" ]]; then
|
||||||
|
UVICORN_ARGS+=("--reload")
|
||||||
|
fi
|
||||||
|
|
||||||
|
nohup uvicorn app.main:app "${UVICORN_ARGS[@]}" > server.log 2>&1 &
|
||||||
echo "Server started (PID: $!). Logs: server.log"
|
echo "Server started (PID: $!). Logs: server.log"
|
||||||
|
|||||||
Reference in New Issue
Block a user