#!/usr/bin/env bash # entrypoint.sh — fetch IndexTTS-2 weights on first run, then exec server. # # IndexTTS2() expects checkpoint files pre-staged under model_dir; if # they're missing, the constructor sys.exit(1)s. Pull them via # huggingface_hub.snapshot_download on first start. ~5-7 GB; subsequent # starts skip the download because config.yaml is the gate. set -e MODEL_DIR="${INDEX_TTS_MODEL_DIR:-/app/checkpoints}" mkdir -p "${MODEL_DIR}" if [ ! -f "${MODEL_DIR}/config.yaml" ]; then echo "[index-tts] downloading IndexTTS-2 weights to ${MODEL_DIR} (~5-7 GB, one-time)" python3 - <