Refactor exporting NeMo models (#2362)

Refactors and extends model export support to include new NeMo Parakeet TDT int8 variants for English and Japanese, updating the Kotlin API, export scripts, test runners, and CI workflows.

- Added support for two new int8 model types in OfflineRecognizer.kt.
- Enhanced Python export scripts to perform dynamic quantization and metadata injection.
- Updated shell scripts and GitHub workflows to package, test, and publish int8 model artifacts.
This commit is contained in:
Fangjun Kuang
2025-07-09 16:02:12 +08:00
committed by GitHub
parent f1405779cf
commit 6122a678f5
19 changed files with 671 additions and 23 deletions

View File

@@ -17,13 +17,24 @@ ms=(
for m in ${ms[@]}; do
./export-onnx-transducer.py --model $m
d=sherpa-onnx-nemo-streaming-fast-conformer-transducer-en-${m}ms
d_int8=sherpa-onnx-nemo-streaming-fast-conformer-transducer-en-${m}ms-int8
if [ ! -f $d/encoder.onnx ]; then
mkdir -p $d
mkdir -p $d $d_int8
mv -v encoder.onnx $d/
mv -v decoder.onnx $d/
mv -v joiner.onnx $d/
mv -v tokens.txt $d/
cp -v tokens.txt $d/
mv -v encoder.int8.onnx $d_int8/
mv -v decoder.int8.onnx $d_int8/
mv -v joiner.int8.onnx $d_int8/
mv -v tokens.txt $d_int8/
echo "---$d---"
ls -lh $d
echo "---$d_int8---"
ls -lh $d_int8
fi
done
@@ -37,4 +48,12 @@ for m in ${ms[@]}; do
--joiner $d/joiner.onnx \
--tokens $d/tokens.txt \
--wav ./0.wav
d=sherpa-onnx-nemo-streaming-fast-conformer-transducer-en-${m}ms-int8
python3 ./test-onnx-transducer.py \
--encoder $d/encoder.int8.onnx \
--decoder $d/decoder.int8.onnx \
--joiner $d/joiner.int8.onnx \
--tokens $d/tokens.txt \
--wav ./0.wav
done