Refactor kokoro export (#2302)

- generate samples for https://k2-fsa.github.io/sherpa/onnx/tts/all/
- provide int8 model for kokoro v0.19 kokoro-int8-en-v0_19.tar.bz2
This commit is contained in:
Fangjun Kuang
2025-06-18 20:30:10 +08:00
committed by GitHub
parent 3878170991
commit 59d118c256
18 changed files with 494 additions and 215 deletions

36
scripts/kokoro/v0.19/run.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Copyright 2025 Xiaomi Corp. (authors: Fangjun Kuang)
set -ex
cat > README-new.md <<EOF
# Introduction
Files in this folder are from
git clone https://huggingface.co/hexgrad/kLegacy
EOF
if [ ! -d kLegacy ]; then
git clone https://huggingface.co/hexgrad/kLegacy
pushd kLegacy/v0.19
git lfs pull
popd
fi
if [ ! -f ./voices.bin ]; then
./generate_voices_bin.py
fi
if [ ! -f ./tokens.txt ]; then
./generate_tokens.py
fi
if [ ! -f ./model.onnx ]; then
mv kLegacy/v0.19/kokoro-v0_19.onnx ./model.onnx
fi
./add_meta_data.py --model ./model.onnx
if [ ! -f model.int8.onnx ]; then
./dynamic_quantization.py
fi