Skip to content

Commit ad53853

Browse files
authored
Update language bindings for FireRedASR CTC models (k2-fsa#3224)
Added offline FireRedASR CTC model support with runnable examples and demos across all language bindings (C/C++, Dart, .NET, Flutter, Go, Java, Kotlin, Node.js, Pascal, Rust, Swift, WebAssembly).
1 parent cbe547a commit ad53853

73 files changed

Lines changed: 2150 additions & 177 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/scripts/test-dart.sh

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,12 @@ set -ex
44

55
cd dart-api-examples
66

7-
pushd tts
8-
9-
echo '----------tts----------'
10-
./run-pocket-en.sh
11-
./run-kitten-en.sh
12-
./run-kokoro-zh-en.sh
13-
./run-kokoro-en.sh
14-
./run-matcha-zh.sh
15-
./run-matcha-en.sh
16-
ls -lh *.wav
17-
rm -rf matcha-icefall-*
18-
rm *.onnx
19-
20-
echo '----------piper tts----------'
21-
./run-piper.sh
22-
rm -rf vits-piper-*
23-
24-
echo '----------coqui tts----------'
25-
./run-coqui.sh
26-
rm -rf vits-coqui-*
7+
pushd non-streaming-asr
278

28-
echo '----------zh tts----------'
29-
./run-vits-zh.sh
9+
echo '----------FireRedASR CTC----------'
10+
./run-fire-red-asr-ctc.sh
3011
rm -rf sherpa-onnx-*
3112

32-
ls -lh *.wav
33-
34-
popd # tts
35-
36-
pushd spoken-language-identification
37-
./run-whisper.sh
38-
popd
39-
40-
pushd non-streaming-asr
41-
4213
echo '----------FunASR Nano----------'
4314
./run-funasr-nano.sh
4415
rm -rf sherpa-onnx-*
@@ -109,6 +80,39 @@ rm -rf sherpa-onnx-*
10980

11081
popd # non-streaming-asr
11182

83+
pushd tts
84+
85+
echo '----------tts----------'
86+
./run-pocket-en.sh
87+
./run-kitten-en.sh
88+
./run-kokoro-zh-en.sh
89+
./run-kokoro-en.sh
90+
./run-matcha-zh.sh
91+
./run-matcha-en.sh
92+
ls -lh *.wav
93+
rm -rf matcha-icefall-*
94+
rm *.onnx
95+
96+
echo '----------piper tts----------'
97+
./run-piper.sh
98+
rm -rf vits-piper-*
99+
100+
echo '----------coqui tts----------'
101+
./run-coqui.sh
102+
rm -rf vits-coqui-*
103+
104+
echo '----------zh tts----------'
105+
./run-vits-zh.sh
106+
rm -rf sherpa-onnx-*
107+
108+
ls -lh *.wav
109+
110+
popd # tts
111+
112+
pushd spoken-language-identification
113+
./run-whisper.sh
114+
popd
115+
112116
pushd streaming-asr
113117

114118
echo '----------streaming T-one ctc----------'

.github/scripts/test-dot-net.sh

Lines changed: 49 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,10 @@ set -ex
44

55
cd dotnet-examples/
66

7-
cd ./pocket-tts-zero-shot
8-
./run.sh
9-
ls -lh
10-
rm -rf sherpa-onnx-pocket-*
11-
12-
cd ../vad-non-streaming-funasr-nano
13-
./run-ten-vad.sh
14-
rm -fv *.onnx
15-
16-
./run.sh
17-
rm -fv *.onnx
18-
19-
cd ../non-streaming-funasr-nano-decode-files
20-
./run.sh
21-
ls -lh
22-
rm -rf sherpa-onnx-funasr-*
7+
cd ./offline-decode-files
238

24-
cd ../version-test
25-
./run.sh
26-
ls -lh
27-
28-
cd ../offline-audio-tagging
29-
./run.sh
30-
ls -lh
31-
rm -rf sherpa-onnx-*
32-
33-
cd ../kitten-tts
34-
./run-kitten.sh
35-
ls -lh
36-
rm -rf kitten-nano-en-v0_1-fp16
37-
38-
cd ../vad-non-streaming-asr-paraformer
39-
./run-ten-vad.sh
40-
rm -fv *.onnx
41-
42-
./run.sh
43-
rm -fv *.onnx
44-
45-
cd ../non-streaming-canary-decode-files
46-
./run.sh
47-
ls -lh
48-
rm -rf sherpa-onnx-nemo-*
49-
50-
cd ../offline-decode-files
9+
./run-fire-red-asr-ctc.sh
10+
rm -rf sherpa-onnx-fire-*
5111

5212
./run-medasr-ctc.sh
5313
rm -rf sherpa-onnx-*
@@ -100,6 +60,52 @@ rm -rf sherpa-onnx-*
10060
./run-tdnn-yesno.sh
10161
rm -rf sherpa-onnx-*
10262

63+
cd ../pocket-tts-zero-shot
64+
./run.sh
65+
ls -lh
66+
rm -rf sherpa-onnx-pocket-*
67+
68+
cd ../vad-non-streaming-funasr-nano
69+
./run-ten-vad.sh
70+
rm -fv *.onnx
71+
72+
./run.sh
73+
rm -fv *.onnx
74+
75+
cd ../non-streaming-funasr-nano-decode-files
76+
./run.sh
77+
ls -lh
78+
rm -rf sherpa-onnx-funasr-*
79+
80+
cd ../version-test
81+
./run.sh
82+
ls -lh
83+
84+
cd ../offline-audio-tagging
85+
./run.sh
86+
ls -lh
87+
rm -rf sherpa-onnx-*
88+
89+
cd ../kitten-tts
90+
./run-kitten.sh
91+
ls -lh
92+
rm -rf kitten-nano-en-v0_1-fp16
93+
94+
cd ../vad-non-streaming-asr-paraformer
95+
./run-ten-vad.sh
96+
rm -fv *.onnx
97+
98+
./run.sh
99+
rm -fv *.onnx
100+
101+
cd ../non-streaming-canary-decode-files
102+
103+
./run.sh
104+
ls -lh
105+
rm -rf sherpa-onnx-nemo-*
106+
107+
108+
103109
cd ../speech-enhancement-gtcrn
104110
./run.sh
105111
ls -lh

.github/scripts/test-nodejs-addon-npm.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ arch=$(node -p "require('os').arch()")
1010
platform=$(node -p "require('os').platform()")
1111
node_version=$(node -p "process.versions.node.split('.')[0]")
1212

13+
echo "----------FireRedAsr CTC----------"
14+
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-fire-red-asr2-ctc-zh_en-int8-2026-02-25.tar.bz2
15+
tar xvf sherpa-onnx-fire-red-asr2-ctc-zh_en-int8-2026-02-25.tar.bz2
16+
rm sherpa-onnx-fire-red-asr2-ctc-zh_en-int8-2026-02-25.tar.bz2
17+
18+
node ./test_asr_non_streaming_fire_red_asr_ctc.js
19+
node ./test_asr_non_streaming_fire_red_asr_ctc_async.js
20+
21+
rm -rf sherpa-onnx-fire-red-asr2-ctc-zh_en-int8-2026-02-25
22+
1323
echo "----------PocketTTS----------"
1424

1525
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/sherpa-onnx-pocket-tts-int8-2026-01-26.tar.bz2
@@ -28,6 +38,8 @@ tar xvf sherpa-onnx-funasr-nano-int8-2025-12-30.tar.bz2
2838
rm sherpa-onnx-funasr-nano-int8-2025-12-30.tar.bz2
2939

3040
node ./test_asr_non_streaming_funasr_nano.js
41+
node ./test_asr_non_streaming_funasr_nano_async.js
42+
3143
rm -rf sherpa-onnx-funasr-nano-int8-2025-12-30
3244

3345
echo "----------non-streaming ASR Google MedASR CTC----------"

.github/scripts/test-nodejs-npm.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,21 @@ git status
99
ls -lh
1010
ls -lh node_modules
1111

12+
echo "---test FireRedASR CTC---"
13+
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-fire-red-asr2-ctc-zh_en-int8-2026-02-25.tar.bz2
14+
tar xvf sherpa-onnx-fire-red-asr2-ctc-zh_en-int8-2026-02-25.tar.bz2
15+
rm sherpa-onnx-fire-red-asr2-ctc-zh_en-int8-2026-02-25.tar.bz2
16+
17+
node ./test-offline-fire-red-asr-ctc.js
18+
19+
rm -rf sherpa-onnx-fire-red-asr2-ctc-zh_en-int8-2026-02-25
20+
1221
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-funasr-nano-int8-2025-12-30.tar.bz2
1322
tar xvf sherpa-onnx-funasr-nano-int8-2025-12-30.tar.bz2
1423
rm sherpa-onnx-funasr-nano-int8-2025-12-30.tar.bz2
1524

1625
node ./test-offline-funasr-nano.js
1726

18-
echo "---async---"
19-
20-
node ./test-offline-funasr-nano_async.js
21-
2227
rm -rf sherpa-onnx-funasr-nano-int8-2025-12-30
2328

2429
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-medasr-ctc-en-int8-2025-12-25.tar.bz2

.github/scripts/test-rust.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ cd rust-api-examples
66

77
./run-version.sh
88

9+
./run-fire-red-asr-ctc.sh
10+
911
./run-silero-vad-remove-silence.sh
1012

1113
./run-nemo-parakeet-en.sh

.github/scripts/test-swift.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ ls -lh
99

1010
./run-test-version.sh
1111

12+
./run-fire-red-asr-ctc.sh
13+
rm -rf sherpa-onnx-fire-red-*
14+
1215
./run-tts-pocket-en.sh
1316
ls -lh
1417
rm -rf sherpa-onnx-pocket-*

.github/workflows/c-api.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,36 @@ jobs:
7575
otool -L ./install/lib/libsherpa-onnx-c-api.dylib
7676
fi
7777
78+
- name: Test FireRedASR CTC
79+
shell: bash
80+
run: |
81+
name=fire-red-asr-ctc-c-api
82+
gcc -o $name ./c-api-examples/$name.c \
83+
-I ./build/install/include \
84+
-L ./build/install/lib/ \
85+
-l sherpa-onnx-c-api \
86+
-l onnxruntime
87+
88+
ls -lh $name
89+
90+
if [[ ${{ matrix.os }} == ubuntu-latest || ${{ matrix.os }} == ubuntu-22.04-arm ]]; then
91+
ldd ./$name
92+
echo "----"
93+
readelf -d ./$name
94+
fi
95+
96+
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-fire-red-asr2-ctc-zh_en-int8-2026-02-25.tar.bz2
97+
tar xvf sherpa-onnx-fire-red-asr2-ctc-zh_en-int8-2026-02-25.tar.bz2
98+
rm sherpa-onnx-fire-red-asr2-ctc-zh_en-int8-2026-02-25.tar.bz2
99+
100+
export LD_LIBRARY_PATH=$PWD/build/install/lib:$LD_LIBRARY_PATH
101+
export DYLD_LIBRARY_PATH=$PWD/build/install/lib:$DYLD_LIBRARY_PATH
102+
103+
./$name
104+
105+
rm $name
106+
rm -rf sherpa-onnx-fire-*
107+
78108
- name: Test PocketTTS
79109
shell: bash
80110
run: |

.github/workflows/cxx-api.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,40 @@ jobs:
7878
otool -L ./install/lib/libsherpa-onnx-cxx-api.dylib
7979
fi
8080
81+
- name: Test FireRedASR CTC
82+
shell: bash
83+
run: |
84+
name=fire-red-asr-ctc-cxx-api
85+
g++ -std=c++17 -o $name ./cxx-api-examples/$name.cc \
86+
-I ./build/install/include \
87+
-L ./build/install/lib/ \
88+
-l sherpa-onnx-cxx-api \
89+
-l sherpa-onnx-c-api \
90+
-l onnxruntime
91+
92+
ls -lh $name
93+
94+
if [[ ${{ matrix.os }} == ubuntu-latest || ${{ matrix.os }} == ubuntu-22.04-arm ]]; then
95+
ls -lh ./$name
96+
ldd ./$name
97+
echo "----"
98+
readelf -d ./$name
99+
fi
100+
101+
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-fire-red-asr2-ctc-zh_en-int8-2026-02-25.tar.bz2
102+
tar xvf sherpa-onnx-fire-red-asr2-ctc-zh_en-int8-2026-02-25.tar.bz2
103+
rm sherpa-onnx-fire-red-asr2-ctc-zh_en-int8-2026-02-25.tar.bz2
104+
105+
echo "---"
106+
107+
export LD_LIBRARY_PATH=$PWD/build/install/lib:$LD_LIBRARY_PATH
108+
export DYLD_LIBRARY_PATH=$PWD/build/install/lib:$DYLD_LIBRARY_PATH
109+
110+
./$name
111+
112+
rm -rf sherpa-onnx-fire-red-*
113+
rm -v ./$name
114+
81115
- name: Test PocketTTS
82116
shell: bash
83117
run: |

.github/workflows/pascal.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ jobs:
219219
rm -rf sherpa-onnx-*
220220
echo "---"
221221
222+
./run-fire-red-asr-ctc.sh
223+
rm -rf sherpa-onnx-fire-red-asr*
224+
echo "---"
225+
222226
./run-fire-red-asr.sh
223227
rm -rf sherpa-onnx-fire-red-asr*
224228
echo "---"

0 commit comments

Comments
 (0)