tts-engine-backend / scripts /bootstrap.sh
thekrocot's picture
Better RVC quality: fp32 content encoder by default, flexible net_g inputs, add neutral RVC voice
25ee2ee
Raw History Blame Contribute Delete
994 Bytes
#!/bin/sh
set -e
cd /app
RVC_CONTENTVEC_QUANTIZED="${RVC_CONTENTVEC_QUANTIZED:-0}"
if [ "${RVC_DISABLE_DOWNLOAD:-0}" = "1" ]; then
echo "[bootstrap] model download disabled (RVC_DISABLE_DOWNLOAD=1)"
elif [ -f models/rvc/contentvec.onnx ] && [ -f models/rvc/rmvpe.onnx ]; then
echo "[bootstrap] RVC base models already present"
else
echo "[bootstrap] downloading RVC base models..."
EXTRA=""
if [ "${RVC_CONTENTVEC_QUANTIZED}" = "1" ]; then
EXTRA="--quantized"
echo "[bootstrap] using int8 content encoder (fast on CPU)"
else
echo "[bootstrap] using fp32 content encoder"
fi
# shellcheck disable=SC2086
python scripts/download_models.py ${EXTRA} --output models/rvc
fi
if [ -f models/rvc/voices.json ]; then
echo "[bootstrap] downloading voice models from manifest..."
python scripts/download_voices.py --manifest models/rvc/voices.json --voices-dir models/rvc/voices
fi
exec uvicorn app.main:app --host 0.0.0.0 --port 7860