24 lines
670 B
Bash
Executable File
24 lines
670 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
python3.11 -m venv .venv
|
|
source .venv/bin/activate
|
|
|
|
python -m pip install -U pip setuptools wheel
|
|
python -m pip install -r requirements.txt
|
|
|
|
# Download UniDic only if mecabrc is missing (fast/no-op if already present)
|
|
python - <<'PY'
|
|
import os, sys, subprocess
|
|
import unidic
|
|
|
|
mecabrc = os.path.join(unidic.DICDIR, "mecabrc")
|
|
if not os.path.exists(mecabrc):
|
|
print("UniDic not downloaded yet -> downloading (this can be large)...")
|
|
subprocess.check_call([sys.executable, "-m", "unidic", "download"])
|
|
else:
|
|
print("UniDic already present:", mecabrc)
|
|
PY
|
|
|
|
# run your tts
|
|
PYTORCH_ENABLE_MPS_FALLBACK=1 python kokoro_ja.py "$@" |