earshelf / source /scripts /fetch-model.sh
WilburDev's picture
Deploy 2026-11-19T12:25Z
4a58e48 verified
Raw History Blame Contribute Delete
614 Bytes
#!/usr/bin/env bash
# Optional: self-host the Kokoro voice model (~165 MB) next to the app, so it never needs Hugging Face.
set -euo pipefail
cd "$(dirname "$0")/../public"
base=https://huggingface.co/onnx-community/Kokoro-82M-v1.0-ONNX/resolve/main
mkdir -p models/kokoro/onnx models/kokoro/voices
for f in config.json tokenizer.json tokenizer_config.json onnx/model_fp16.onnx voices/af_heart.bin voices/af_bella.bin voices/am_michael.bin voices/am_fenrir.bin voices/bf_emma.bin voices/bm_george.bin; do
[ -s "models/kokoro/$f" ] || curl -fL --retry 3 -o "models/kokoro/$f" "$base/$f"
done
du -sh models/kokoro