Initial commit after re-install

This commit is contained in:
2026-02-25 19:07:56 +09:00
commit 7adaa73102
12 changed files with 1848 additions and 0 deletions

33
run.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env bash
set -euo pipefail
if [[ -z "${BASH_VERSION:-}" ]]; then
echo "ERROR: bash로 실행하세요. 예) ./run.sh 또는 bash run.sh" >&2
exit 1
fi
cd /home/dsyoon/workspace/stt
CONDA_BASE="/home/dsyoon/workspace/miniconda3"
source "${CONDA_BASE}/bin/activate" ncue
# Torch/ctranslate2 런타임 로딩에 conda lib 경로 필요할 수 있음
export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH:-}"
PORT="${PORT:-8025}"
RELOAD="${RELOAD:-0}"
if lsof -ti tcp:"${PORT}" >/dev/null 2>&1; then
echo "Stopping existing server on port ${PORT}..."
lsof -ti tcp:"${PORT}" | xargs -r kill -9
sleep 1
fi
UVICORN_ARGS=("--host" "127.0.0.1" "--port" "${PORT}")
if [[ "${RELOAD}" == "1" ]]; then
UVICORN_ARGS+=("--reload")
fi
echo "Starting uvicorn on 127.0.0.1:${PORT} (reload=${RELOAD})"
nohup uvicorn app.main:app "${UVICORN_ARGS[@]}" > server.log 2>&1 &
echo "Server started (PID: $!). Logs: server.log"