-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·30 lines (25 loc) · 814 Bytes
/
Copy pathrun.sh
File metadata and controls
executable file
·30 lines (25 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
# Start the AI Dubbing Studio locally.
set -euo pipefail
cd "$(dirname "$0")"
PYTHON="${PYTHON:-python3}"
if [ ! -d .venv ] && [ "${DUB_NO_VENV:-0}" != "1" ]; then
echo "→ creating virtualenv in .venv"
"$PYTHON" -m venv .venv
fi
if [ -d .venv ]; then
# shellcheck disable=SC1091
source .venv/bin/activate
PYTHON=python
fi
echo "→ installing requirements"
"$PYTHON" -m pip install --quiet --upgrade pip
"$PYTHON" -m pip install --quiet -r requirements.txt
if [ ! -f data/sample.wav ]; then
echo "→ generating demo clip at data/sample.wav"
"$PYTHON" scripts/make_sample.py data/sample.wav || true
fi
HOST="${DUB_HOST:-127.0.0.1}"
PORT="${DUB_PORT:-8000}"
echo "→ open http://${HOST}:${PORT}"
exec "$PYTHON" -m uvicorn backend.app.main:app --host "$HOST" --port "$PORT"