OCR Worker: add check and systemd install scripts.
This commit is contained in:
@@ -6,12 +6,21 @@ VENV="${ROOT}/.venv"
|
||||
HOST="${OCR_HOST:-0.0.0.0}"
|
||||
PORT="${OCR_PORT:-23567}"
|
||||
|
||||
export OCR_USE_GPU="${OCR_USE_GPU:-true}"
|
||||
export OCR_HOST="${HOST}"
|
||||
export OCR_PORT="${PORT}"
|
||||
|
||||
if [[ ! -d "${VENV}" ]]; then
|
||||
echo "未找到虚拟环境,请先运行: bash install.sh"
|
||||
echo "未找到虚拟环境,请先在本目录运行: bash install.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
source "${VENV}/bin/activate"
|
||||
cd "${ROOT}"
|
||||
exec uvicorn app:app --host "${HOST}" --port "${PORT}"
|
||||
|
||||
echo "==> 启动 OCR Worker: http://${HOST}:${PORT} (GPU=${OCR_USE_GPU})"
|
||||
echo " 按 Ctrl+C 停止。后台运行请用: sudo bash install-service.sh"
|
||||
echo ""
|
||||
|
||||
exec uvicorn app:app --host "${HOST}" --port "${PORT}" --log-level info
|
||||
|
||||
Reference in New Issue
Block a user