Spaces:
Running
Running
File size: 994 Bytes
9cb73e8 25ee2ee 9cb73e8 53606f7 9cb73e8 | 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 | #!/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 |