Add PengChengStarling models to sherpa-onnx (#1835)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Introduction
|
||||
|
||||
This folder contains script for adding meta data to tts models
|
||||
This folder contains scripts for adding meta data to tts models
|
||||
from https://github.com/shivammehta25/Matcha-TTS
|
||||
|
||||
Note: If you use icefall to train a MatchaTTS model, you don't need this folder.
|
||||
|
||||
3
scripts/peng-cheng-starling/.gitignore
vendored
Normal file
3
scripts/peng-cheng-starling/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
bpe.model
|
||||
*.wav
|
||||
*.onnx
|
||||
4
scripts/peng-cheng-starling/README.md
Normal file
4
scripts/peng-cheng-starling/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# Introduction
|
||||
|
||||
This folder contains scripts for files from
|
||||
https://github.com/yangb05/PengChengStarling
|
||||
22
scripts/peng-cheng-starling/quantize_models.py
Executable file
22
scripts/peng-cheng-starling/quantize_models.py
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
from onnxruntime.quantization import QuantType, quantize_dynamic
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def main():
|
||||
suffix = "epoch-75-avg-11-chunk-16-left-128"
|
||||
|
||||
for m in ["encoder", "joiner"]:
|
||||
if Path(f"{m}-{suffix}.int8.onnx").is_file():
|
||||
continue
|
||||
|
||||
quantize_dynamic(
|
||||
model_input=f"./{m}-{suffix}.onnx",
|
||||
model_output=f"./{m}-{suffix}.int8.onnx",
|
||||
op_types_to_quantize=["MatMul"],
|
||||
weight_type=QuantType.QInt8,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
36
scripts/peng-cheng-starling/run.sh
Executable file
36
scripts/peng-cheng-starling/run.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
if [ ! -f bpe.model ]; then
|
||||
curl -SL -O https://huggingface.co/stdo/PengChengStarling/resolve/main/bpe.model
|
||||
fi
|
||||
|
||||
if [ ! -f tokens.txt ]; then
|
||||
curl -SL -O https://huggingface.co/stdo/PengChengStarling/resolve/main/tokens.txt
|
||||
fi
|
||||
|
||||
if [ ! -f decoder-epoch-75-avg-11-chunk-16-left-128.onnx ]; then
|
||||
curl -SL -O https://huggingface.co/stdo/PengChengStarling/resolve/main/decoder-epoch-75-avg-11-chunk-16-left-128.onnx
|
||||
fi
|
||||
|
||||
if [ ! -f encoder-epoch-75-avg-11-chunk-16-left-128.onnx ]; then
|
||||
curl -SL -O https://huggingface.co/stdo/PengChengStarling/resolve/main/encoder-epoch-75-avg-11-chunk-16-left-128.onnx
|
||||
fi
|
||||
|
||||
if [ ! -f joiner-epoch-75-avg-11-chunk-16-left-128.onnx ]; then
|
||||
curl -SL -O https://huggingface.co/stdo/PengChengStarling/resolve/main/joiner-epoch-75-avg-11-chunk-16-left-128.onnx
|
||||
fi
|
||||
|
||||
mkdir -p test_wavs
|
||||
if [ ! -f test_wavs/zh.wav ]; then
|
||||
curl -SL --output test_wavs/zh.wav https://huggingface.co/marcoyang/sherpa-ncnn-streaming-zipformer-zh-14M-2023-02-23/resolve/main/test_wavs/0.wav
|
||||
fi
|
||||
|
||||
if [ ! -f test_wavs/en.wav ]; then
|
||||
curl -SL --output test_wavs/en.wav https://huggingface.co/csukuangfj/sherpa-onnx-streaming-zipformer-en-2023-02-21/resolve/main/test_wavs/0.wav
|
||||
fi
|
||||
|
||||
if [ ! -f test_wavs/ja.wav ]; then
|
||||
curl -SL --output test_wavs/ja.wav https://huggingface.co/csukuangfj/reazonspeech-k2-v2/resolve/main/test_wavs/5.wav
|
||||
fi
|
||||
Reference in New Issue
Block a user