From 3c5a6502c70ae676a1c1344cf210f025febcae14 Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Wed, 10 Jul 2024 14:47:06 +0800 Subject: [PATCH] fix typos --- .../SherpaOnnx2Pass/SherpaOnnxViewModel.swift | 2 +- .../SubtitleViewModel.swift | 2 +- ...xtNormalizationNonStreamingParaformer.java | 6 ++--- .../NonStreamingDecodeFileParaformer.java | 8 +++---- .../VadFromMicWithNonStreamingParaformer.java | 6 ++--- .../VadNonStreamingParaformer.java | 6 ++--- ...n-inverse-text-normalization-paraformer.sh | 8 +++---- ...un-non-streaming-decode-file-paraformer.sh | 8 +++---- ...n-vad-from-mic-non-streaming-paraformer.sh | 8 +++---- .../run-vad-non-streaming-paraformer.sh | 8 +++---- kotlin-api-examples/run.sh | 16 +++++++------- kotlin-api-examples/test_offline_asr.kt | 2 +- .../NonStreamingSpeechRecognitionDlg.cpp | 4 ++-- nodejs-addon-examples/README.md | 12 +++++----- .../test_asr_non_streaming_paraformer.js | 6 ++--- .../test_asr_non_streaming_paraformer_itn.js | 4 ++-- ...asr_non_streaming_paraformer_microphone.js | 4 ++-- nodejs-examples/README.md | 6 ++--- .../test-offline-paraformer-itn.js | 4 ++-- nodejs-examples/test-offline-paraformer.js | 6 ++--- .../inverse-text-normalization-offline-asr.py | 10 ++++----- python-api-examples/non_streaming_server.py | 10 ++++----- ...pass-speech-recognition-from-microphone.py | 4 ++-- scripts/apk/generate-asr-2pass-apk-script.py | 4 ++-- scripts/apk/generate-vad-asr-apk-script.py | 2 +- sherpa-onnx/kotlin-api/OfflineRecognizer.kt | 6 ++--- .../python/tests/test_offline_recognizer.py | 22 +++++++++---------- 27 files changed, 92 insertions(+), 92 deletions(-) diff --git a/ios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass/SherpaOnnxViewModel.swift b/ios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass/SherpaOnnxViewModel.swift index eb11e83b7..4c447f451 100644 --- a/ios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass/SherpaOnnxViewModel.swift +++ b/ios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass/SherpaOnnxViewModel.swift @@ -90,7 +90,7 @@ class SherpaOnnxViewModel: ObservableObject { } private func initOfflineRecognizer() { - // let modelConfig = getNonStreamingZhParaformer20230419() + // let modelConfig = getNonStreamingZhParaformer20230914() let modelConfig = getNonStreamingWhisperTinyEn() // let modelConfig = getNonStreamingEnZipformer20230504() diff --git a/ios-swiftui/SherpaOnnxSubtitle/SherpaOnnxSubtitle/SubtitleViewModel.swift b/ios-swiftui/SherpaOnnxSubtitle/SherpaOnnxSubtitle/SubtitleViewModel.swift index 4176dcb33..554ee0256 100644 --- a/ios-swiftui/SherpaOnnxSubtitle/SherpaOnnxSubtitle/SubtitleViewModel.swift +++ b/ios-swiftui/SherpaOnnxSubtitle/SherpaOnnxSubtitle/SubtitleViewModel.swift @@ -59,7 +59,7 @@ class SubtitleViewModel: ObservableObject { self.modelConfig = getNonStreamingWhisperTinyEn() } else if modelType == "paraformer" { // for Chinese - self.modelConfig = getNonStreamingZhParaformer20230419() + self.modelConfig = getNonStreamingZhParaformer20230914() } else { print("Please specify a supported modelType \(modelType)") return diff --git a/java-api-examples/InverseTextNormalizationNonStreamingParaformer.java b/java-api-examples/InverseTextNormalizationNonStreamingParaformer.java index 972107be5..9d0797198 100644 --- a/java-api-examples/InverseTextNormalizationNonStreamingParaformer.java +++ b/java-api-examples/InverseTextNormalizationNonStreamingParaformer.java @@ -7,10 +7,10 @@ public class InverseTextNormalizationNonStreamingParaformer { public static void main(String[] args) { // please refer to - // https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-paraformer/paraformer-models.html#csukuangfj-sherpa-onnx-paraformer-zh-2023-04-19-chinese-english + // https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-paraformer/paraformer-models.html#csukuangfj-sherpa-onnx-paraformer-zh-2023-09-14-chinese-english // to download model files - String model = "./sherpa-onnx-paraformer-zh-2023-04-19/model.int8.onnx"; - String tokens = "./sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt"; + String model = "./sherpa-onnx-paraformer-zh-2023-09-14/model.int8.onnx"; + String tokens = "./sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt"; // https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/itn-zh-number.wav String waveFilename = "./itn-zh-number.wav"; diff --git a/java-api-examples/NonStreamingDecodeFileParaformer.java b/java-api-examples/NonStreamingDecodeFileParaformer.java index d997281e7..4b0cd82fb 100644 --- a/java-api-examples/NonStreamingDecodeFileParaformer.java +++ b/java-api-examples/NonStreamingDecodeFileParaformer.java @@ -7,12 +7,12 @@ public class NonStreamingDecodeFileParaformer { public static void main(String[] args) { // please refer to - // https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-paraformer/paraformer-models.html#csukuangfj-sherpa-onnx-paraformer-zh-2023-04-19-chinese-english + // https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-paraformer/paraformer-models.html#csukuangfj-sherpa-onnx-paraformer-zh-2023-09-14-chinese-english // to download model files - String model = "./sherpa-onnx-paraformer-zh-2023-04-19/model.int8.onnx"; - String tokens = "./sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt"; + String model = "./sherpa-onnx-paraformer-zh-2023-09-14/model.int8.onnx"; + String tokens = "./sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt"; - String waveFilename = "./sherpa-onnx-paraformer-zh-2023-04-19/test_wavs/3-sichuan.wav"; + String waveFilename = "./sherpa-onnx-paraformer-zh-2023-09-14/test_wavs/3-sichuan.wav"; WaveReader reader = new WaveReader(waveFilename); diff --git a/java-api-examples/VadFromMicWithNonStreamingParaformer.java b/java-api-examples/VadFromMicWithNonStreamingParaformer.java index d43fa6d95..bae88d6fc 100644 --- a/java-api-examples/VadFromMicWithNonStreamingParaformer.java +++ b/java-api-examples/VadFromMicWithNonStreamingParaformer.java @@ -37,10 +37,10 @@ public static Vad createVad() { public static OfflineRecognizer createOfflineRecognizer() { // please refer to - // https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-paraformer/paraformer-models.html#csukuangfj-sherpa-onnx-paraformer-zh-2023-04-19-chinese-english + // https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-paraformer/paraformer-models.html#csukuangfj-sherpa-onnx-paraformer-zh-2023-09-14-chinese-english // to download model files - String model = "./sherpa-onnx-paraformer-zh-2023-04-19/model.int8.onnx"; - String tokens = "./sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt"; + String model = "./sherpa-onnx-paraformer-zh-2023-09-14/model.int8.onnx"; + String tokens = "./sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt"; // https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/itn_zh_number.fst String ruleFsts = "./itn_zh_number.fst"; diff --git a/java-api-examples/VadNonStreamingParaformer.java b/java-api-examples/VadNonStreamingParaformer.java index 5dea503b7..eb57f4c14 100644 --- a/java-api-examples/VadNonStreamingParaformer.java +++ b/java-api-examples/VadNonStreamingParaformer.java @@ -34,10 +34,10 @@ public static Vad createVad() { public static OfflineRecognizer createOfflineRecognizer() { // please refer to - // https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-paraformer/paraformer-models.html#csukuangfj-sherpa-onnx-paraformer-zh-2023-04-19-chinese-english + // https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-paraformer/paraformer-models.html#csukuangfj-sherpa-onnx-paraformer-zh-2023-09-14-chinese-english // to download model files - String model = "./sherpa-onnx-paraformer-zh-2023-04-19/model.int8.onnx"; - String tokens = "./sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt"; + String model = "./sherpa-onnx-paraformer-zh-2023-09-14/model.int8.onnx"; + String tokens = "./sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt"; OfflineParaformerModelConfig paraformer = OfflineParaformerModelConfig.builder().setModel(model).build(); diff --git a/java-api-examples/run-inverse-text-normalization-paraformer.sh b/java-api-examples/run-inverse-text-normalization-paraformer.sh index e5ba546a2..c9f20bf49 100755 --- a/java-api-examples/run-inverse-text-normalization-paraformer.sh +++ b/java-api-examples/run-inverse-text-normalization-paraformer.sh @@ -25,11 +25,11 @@ if [ ! -f ../sherpa-onnx/java-api/build/sherpa-onnx.jar ]; then popd fi -if [ ! -f ./sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt ]; then - curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 +if [ ! -f ./sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt ]; then + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 - tar xvf sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 - rm sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 + tar xvf sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 + rm sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 fi if [ ! -f ./itn-zh-number.wav ]; then diff --git a/java-api-examples/run-non-streaming-decode-file-paraformer.sh b/java-api-examples/run-non-streaming-decode-file-paraformer.sh index cef821fe9..5227bcd62 100755 --- a/java-api-examples/run-non-streaming-decode-file-paraformer.sh +++ b/java-api-examples/run-non-streaming-decode-file-paraformer.sh @@ -25,11 +25,11 @@ if [ ! -f ../sherpa-onnx/java-api/build/sherpa-onnx.jar ]; then popd fi -if [ ! -f ./sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt ]; then - curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 +if [ ! -f ./sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt ]; then + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 - tar xvf sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 - rm sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 + tar xvf sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 + rm sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 fi java \ diff --git a/java-api-examples/run-vad-from-mic-non-streaming-paraformer.sh b/java-api-examples/run-vad-from-mic-non-streaming-paraformer.sh index 384bc1f5e..d59a0294c 100755 --- a/java-api-examples/run-vad-from-mic-non-streaming-paraformer.sh +++ b/java-api-examples/run-vad-from-mic-non-streaming-paraformer.sh @@ -29,11 +29,11 @@ if [ ! -f ./silero_vad.onnx ]; then curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/silero_vad.onnx fi -if [ ! -f ./sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt ]; then - curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 +if [ ! -f ./sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt ]; then + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 - tar xvf sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 - rm sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 + tar xvf sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 + rm sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 fi if [ ! -f ./itn_zh_number.fst ]; then diff --git a/java-api-examples/run-vad-non-streaming-paraformer.sh b/java-api-examples/run-vad-non-streaming-paraformer.sh index 5001138a2..cc8439a06 100755 --- a/java-api-examples/run-vad-non-streaming-paraformer.sh +++ b/java-api-examples/run-vad-non-streaming-paraformer.sh @@ -33,11 +33,11 @@ if [ ! -f ./lei-jun-test.wav ]; then curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/lei-jun-test.wav fi -if [ ! -f ./sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt ]; then - curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 +if [ ! -f ./sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt ]; then + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 - tar xvf sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 - rm sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 + tar xvf sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 + rm sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 fi java \ diff --git a/kotlin-api-examples/run.sh b/kotlin-api-examples/run.sh index cbef0ce1d..39a839693 100755 --- a/kotlin-api-examples/run.sh +++ b/kotlin-api-examples/run.sh @@ -179,10 +179,10 @@ function testOfflineAsr() { rm sherpa-onnx-nemo-ctc-en-citrinet-512.tar.bz2 fi - if [ ! -f ./sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt ]; then - curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 - tar xvf sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 - rm sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 + if [ ! -f ./sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt ]; then + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 + tar xvf sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 + rm sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 fi if [ ! -f ./sherpa-onnx-zipformer-multi-zh-hans-2023-9-2/tokens.txt ]; then @@ -205,10 +205,10 @@ function testOfflineAsr() { } function testInverseTextNormalizationOfflineAsr() { - if [ ! -f ./sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt ]; then - curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 - tar xvf sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 - rm sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 + if [ ! -f ./sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt ]; then + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 + tar xvf sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 + rm sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 fi if [ ! -f ./itn-zh-number.wav ]; then diff --git a/kotlin-api-examples/test_offline_asr.kt b/kotlin-api-examples/test_offline_asr.kt index cb0e602bc..2d6997bc5 100644 --- a/kotlin-api-examples/test_offline_asr.kt +++ b/kotlin-api-examples/test_offline_asr.kt @@ -11,7 +11,7 @@ fun test(type: Int) { val recognizer = createOfflineRecognizer(type) val waveFilename = when (type) { - 0 -> "./sherpa-onnx-paraformer-zh-2023-04-19/test_wavs/0.wav" + 0 -> "./sherpa-onnx-paraformer-zh-2023-09-14/test_wavs/0.wav" 2 -> "./sherpa-onnx-whisper-tiny.en/test_wavs/0.wav" 5 -> "./sherpa-onnx-zipformer-multi-zh-hans-2023-9-2/test_wavs/1.wav" 6 -> "./sherpa-onnx-nemo-ctc-en-citrinet-512/test_wavs/8k.wav" diff --git a/mfc-examples/NonStreamingSpeechRecognition/NonStreamingSpeechRecognitionDlg.cpp b/mfc-examples/NonStreamingSpeechRecognition/NonStreamingSpeechRecognitionDlg.cpp index f8de5a297..8c16324e3 100644 --- a/mfc-examples/NonStreamingSpeechRecognition/NonStreamingSpeechRecognitionDlg.cpp +++ b/mfc-examples/NonStreamingSpeechRecognition/NonStreamingSpeechRecognitionDlg.cpp @@ -338,10 +338,10 @@ void CNonStreamingSpeechRecognitionDlg::ShowInitRecognizerHelpMessage() { msg += "wget " "https://huggingface.co/csukuangfj/" - "sherpa-onnx-paraformer-zh-2023-04-19/resolve/main/model.onnx\r\n"; + "sherpa-onnx-paraformer-zh-2023-09-14/resolve/main/model.onnx\r\n"; msg += "wget " - "https://huggingface.co/csukuangfj/sherpa-onnx-paraformer-zh-2023-04-19/" + "https://huggingface.co/csukuangfj/sherpa-onnx-paraformer-zh-2023-09-14/" "resolve/main/tokens.txt\r\n\r\n"; msg += "\r\n Now rename them\r\n"; msg += "mv model.onnx paraformer.onnx\r\n\r\n"; diff --git a/nodejs-addon-examples/README.md b/nodejs-addon-examples/README.md index 59528e47b..29e86800d 100644 --- a/nodejs-addon-examples/README.md +++ b/nodejs-addon-examples/README.md @@ -140,9 +140,9 @@ node ./test_audio_tagging_zipformer.js ### Audio tagging with CED ```bash -wget https://github.com/k2-fsa/sherpa-onnx/releases/download/audio-tagging-models/sherpa-onnx-ced-mini-audio-tagging-2024-04-19.tar.bz2 -tar xvf sherpa-onnx-ced-mini-audio-tagging-2024-04-19.tar.bz2 -rm sherpa-onnx-ced-mini-audio-tagging-2024-04-19.tar.bz2 +wget https://github.com/k2-fsa/sherpa-onnx/releases/download/audio-tagging-models/sherpa-onnx-ced-mini-audio-tagging-2024-09-14.tar.bz2 +tar xvf sherpa-onnx-ced-mini-audio-tagging-2024-09-14.tar.bz2 +rm sherpa-onnx-ced-mini-audio-tagging-2024-09-14.tar.bz2 node ./test_audio_tagging_ced.js ``` @@ -241,9 +241,9 @@ node ./test_vad_asr_non_streaming_nemo_ctc_microphone.js ### Non-streaming speech recognition with Paraformer ```bash -wget https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 -tar xvf sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 -rm sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 +wget https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 +tar xvf sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 +rm sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 node ./test_asr_non_streaming_paraformer.js diff --git a/nodejs-addon-examples/test_asr_non_streaming_paraformer.js b/nodejs-addon-examples/test_asr_non_streaming_paraformer.js index e29f10d16..6fcc434ed 100644 --- a/nodejs-addon-examples/test_asr_non_streaming_paraformer.js +++ b/nodejs-addon-examples/test_asr_non_streaming_paraformer.js @@ -10,9 +10,9 @@ const config = { }, 'modelConfig': { 'paraformer': { - 'model': './sherpa-onnx-paraformer-zh-2023-04-19/model.int8.onnx', + 'model': './sherpa-onnx-paraformer-zh-2023-09-14/model.int8.onnx', }, - 'tokens': './sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt', + 'tokens': './sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt', 'numThreads': 2, 'provider': 'cpu', 'debug': 1, @@ -20,7 +20,7 @@ const config = { }; const waveFilename = - './sherpa-onnx-paraformer-zh-2023-04-19/test_wavs/5-henan.wav'; + './sherpa-onnx-paraformer-zh-2023-09-14/test_wavs/5-henan.wav'; const recognizer = new sherpa_onnx.OfflineRecognizer(config); console.log('Started') diff --git a/nodejs-addon-examples/test_asr_non_streaming_paraformer_itn.js b/nodejs-addon-examples/test_asr_non_streaming_paraformer_itn.js index e47ddcf47..8baa2a0bf 100644 --- a/nodejs-addon-examples/test_asr_non_streaming_paraformer_itn.js +++ b/nodejs-addon-examples/test_asr_non_streaming_paraformer_itn.js @@ -10,9 +10,9 @@ const config = { }, 'modelConfig': { 'paraformer': { - 'model': './sherpa-onnx-paraformer-zh-2023-04-19/model.int8.onnx', + 'model': './sherpa-onnx-paraformer-zh-2023-09-14/model.int8.onnx', }, - 'tokens': './sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt', + 'tokens': './sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt', 'numThreads': 2, 'provider': 'cpu', 'debug': 1, diff --git a/nodejs-addon-examples/test_vad_asr_non_streaming_paraformer_microphone.js b/nodejs-addon-examples/test_vad_asr_non_streaming_paraformer_microphone.js index 85551accc..ec33e8ae6 100644 --- a/nodejs-addon-examples/test_vad_asr_non_streaming_paraformer_microphone.js +++ b/nodejs-addon-examples/test_vad_asr_non_streaming_paraformer_microphone.js @@ -15,9 +15,9 @@ function createRecognizer() { }, 'modelConfig': { 'paraformer': { - 'model': './sherpa-onnx-paraformer-zh-2023-04-19/model.int8.onnx', + 'model': './sherpa-onnx-paraformer-zh-2023-09-14/model.int8.onnx', }, - 'tokens': './sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt', + 'tokens': './sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt', 'numThreads': 2, 'provider': 'cpu', 'debug': 1, diff --git a/nodejs-examples/README.md b/nodejs-examples/README.md index cc259e889..3399b8255 100644 --- a/nodejs-examples/README.md +++ b/nodejs-examples/README.md @@ -78,13 +78,13 @@ node ./test-offline-nemo-ctc.js [./test-offline-paraformer.js](./test-offline-paraformer.js) demonstrates how to decode a file with a non-streaming Paraformer model. In the code we use -[sherpa-onnx-paraformer-zh-2023-04-19](https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-paraformer/paraformer-models.html#csukuangfj-sherpa-onnx-paraformer-zh-2023-04-19-chinese). +[sherpa-onnx-paraformer-zh-2023-09-14](https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-paraformer/paraformer-models.html#csukuangfj-sherpa-onnx-paraformer-zh-2023-09-14-chinese). You can use the following command to run it: ```bash -wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 -tar xvf sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 +wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 +tar xvf sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 node ./test-offline-paraformer.js ``` diff --git a/nodejs-examples/test-offline-paraformer-itn.js b/nodejs-examples/test-offline-paraformer-itn.js index f5a2e39fe..3acb69744 100644 --- a/nodejs-examples/test-offline-paraformer-itn.js +++ b/nodejs-examples/test-offline-paraformer-itn.js @@ -19,7 +19,7 @@ function createOfflineRecognizer() { joiner: '', }, paraformer: { - model: './sherpa-onnx-paraformer-zh-2023-04-19/model.int8.onnx', + model: './sherpa-onnx-paraformer-zh-2023-09-14/model.int8.onnx', }, nemoCtc: { model: '', @@ -34,7 +34,7 @@ function createOfflineRecognizer() { tdnn: { model: '', }, - tokens: './sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt', + tokens: './sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt', numThreads: 1, debug: 0, provider: 'cpu', diff --git a/nodejs-examples/test-offline-paraformer.js b/nodejs-examples/test-offline-paraformer.js index 0bc9ed119..800ebcbd8 100644 --- a/nodejs-examples/test-offline-paraformer.js +++ b/nodejs-examples/test-offline-paraformer.js @@ -19,7 +19,7 @@ function createOfflineRecognizer() { joiner: '', }, paraformer: { - model: './sherpa-onnx-paraformer-zh-2023-04-19/model.int8.onnx', + model: './sherpa-onnx-paraformer-zh-2023-09-14/model.int8.onnx', }, nemoCtc: { model: '', @@ -34,7 +34,7 @@ function createOfflineRecognizer() { tdnn: { model: '', }, - tokens: './sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt', + tokens: './sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt', numThreads: 1, debug: 0, provider: 'cpu', @@ -63,7 +63,7 @@ function createOfflineRecognizer() { const recognizer = createOfflineRecognizer(); const stream = recognizer.createStream(); -const waveFilename = './sherpa-onnx-paraformer-zh-2023-04-19/test_wavs/0.wav'; +const waveFilename = './sherpa-onnx-paraformer-zh-2023-09-14/test_wavs/0.wav'; const reader = new wav.Reader(); const readable = new Readable().wrap(reader); diff --git a/python-api-examples/inverse-text-normalization-offline-asr.py b/python-api-examples/inverse-text-normalization-offline-asr.py index 2a40d1718..7ccd926ab 100755 --- a/python-api-examples/inverse-text-normalization-offline-asr.py +++ b/python-api-examples/inverse-text-normalization-offline-asr.py @@ -9,9 +9,9 @@ (1) Download the test model -wget https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 -tar xvf sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 -rm sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 +wget https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 +tar xvf sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 +rm sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 (2) Download rule fst @@ -36,8 +36,8 @@ def create_recognizer(): - model = "./sherpa-onnx-paraformer-zh-2023-04-19/model.int8.onnx" - tokens = "./sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt" + model = "./sherpa-onnx-paraformer-zh-2023-09-14/model.int8.onnx" + tokens = "./sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt" rule_fsts = "./itn_zh_number.fst" if ( diff --git a/python-api-examples/non_streaming_server.py b/python-api-examples/non_streaming_server.py index 6f9f4f10f..d82c5c528 100755 --- a/python-api-examples/non_streaming_server.py +++ b/python-api-examples/non_streaming_server.py @@ -36,13 +36,13 @@ (2) Use a non-streaming paraformer cd /path/to/sherpa-onnx -curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 -tar xvf sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 -rm sherpa-onnx-paraformer-zh-2023-04-19.tar.bz2 +curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 +tar xvf sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 +rm sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2 python3 ./python-api-examples/non_streaming_server.py \ - --paraformer ./sherpa-onnx-paraformer-zh-2023-04-19/model.int8.onnx \ - --tokens ./sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt + --paraformer ./sherpa-onnx-paraformer-zh-2023-09-14/model.int8.onnx \ + --tokens ./sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt (3) Use a non-streaming CTC model from NeMo diff --git a/python-api-examples/two-pass-speech-recognition-from-microphone.py b/python-api-examples/two-pass-speech-recognition-from-microphone.py index 3c558be7b..d83359e06 100755 --- a/python-api-examples/two-pass-speech-recognition-from-microphone.py +++ b/python-api-examples/two-pass-speech-recognition-from-microphone.py @@ -27,8 +27,8 @@ --first-joiner ./sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23/joiner-epoch-99-avg-1.onnx \ --first-tokens ./sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23/tokens.txt \ \ - --second-paraformer ./sherpa-onnx-paraformer-zh-2023-04-19/model.int8.onnx \ - --second-tokens ./sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt + --second-paraformer ./sherpa-onnx-paraformer-zh-2023-09-14/model.int8.onnx \ + --second-tokens ./sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt (2) English: Streaming zipformer (1st pass) + Non-streaming whisper (2nd pass) diff --git a/scripts/apk/generate-asr-2pass-apk-script.py b/scripts/apk/generate-asr-2pass-apk-script.py index 018b9430f..1b3d75237 100755 --- a/scripts/apk/generate-asr-2pass-apk-script.py +++ b/scripts/apk/generate-asr-2pass-apk-script.py @@ -67,7 +67,7 @@ def get_2nd_models(): """, ), Model( - model_name="sherpa-onnx-paraformer-zh-2023-04-19", + model_name="sherpa-onnx-paraformer-zh-2023-09-14", idx=0, lang="zh", short_name="paraformer", @@ -270,7 +270,7 @@ def get_models(): combinations = [ ( "sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23", - "sherpa-onnx-paraformer-zh-2023-04-19", + "sherpa-onnx-paraformer-zh-2023-09-14", ), ( "sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23", diff --git a/scripts/apk/generate-vad-asr-apk-script.py b/scripts/apk/generate-vad-asr-apk-script.py index 3045e0e51..a42d23c2b 100755 --- a/scripts/apk/generate-vad-asr-apk-script.py +++ b/scripts/apk/generate-vad-asr-apk-script.py @@ -69,7 +69,7 @@ def get_models(): """, ), Model( - model_name="sherpa-onnx-paraformer-zh-2023-04-19", + model_name="sherpa-onnx-paraformer-zh-2023-09-14", idx=0, lang="zh", short_name="paraformer", diff --git a/sherpa-onnx/kotlin-api/OfflineRecognizer.kt b/sherpa-onnx/kotlin-api/OfflineRecognizer.kt index 5f73da53d..b8a53f05d 100644 --- a/sherpa-onnx/kotlin-api/OfflineRecognizer.kt +++ b/sherpa-onnx/kotlin-api/OfflineRecognizer.kt @@ -128,8 +128,8 @@ by following the code) @param type -0 - csukuangfj/sherpa-onnx-paraformer-zh-2023-04-19 (Chinese) - https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-paraformer/paraformer-models.html#csukuangfj-sherpa-onnx-paraformer-zh-2023-04-19-chinese +0 - csukuangfj/sherpa-onnx-paraformer-zh-2023-09-14 (Chinese) + https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-paraformer/paraformer-models.html#csukuangfj-sherpa-onnx-paraformer-zh-2023-09-14-chinese int8 1 - icefall-asr-multidataset-pruned_transducer_stateless7-2023-05-04 (English) @@ -152,7 +152,7 @@ by following the code) fun getOfflineModelConfig(type: Int): OfflineModelConfig? { when (type) { 0 -> { - val modelDir = "sherpa-onnx-paraformer-zh-2023-04-19" + val modelDir = "sherpa-onnx-paraformer-zh-2023-09-14" return OfflineModelConfig( paraformer = OfflineParaformerModelConfig( model = "$modelDir/model.int8.onnx", diff --git a/sherpa-onnx/python/tests/test_offline_recognizer.py b/sherpa-onnx/python/tests/test_offline_recognizer.py index 76f1b0ab2..5f2f02984 100755 --- a/sherpa-onnx/python/tests/test_offline_recognizer.py +++ b/sherpa-onnx/python/tests/test_offline_recognizer.py @@ -130,12 +130,12 @@ def test_transducer_multiple_files(self): def test_paraformer_single_file(self): for use_int8 in [True, False]: if use_int8: - model = f"{d}/sherpa-onnx-paraformer-zh-2023-04-19/model.int8.onnx" + model = f"{d}/sherpa-onnx-paraformer-zh-2023-09-14/model.int8.onnx" else: - model = f"{d}/sherpa-onnx-paraformer-zh-2023-04-19/model.onnx" + model = f"{d}/sherpa-onnx-paraformer-zh-2023-09-14/model.onnx" - tokens = f"{d}/sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt" - wave0 = f"{d}/sherpa-onnx-paraformer-zh-2023-04-19/test_wavs/0.wav" + tokens = f"{d}/sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt" + wave0 = f"{d}/sherpa-onnx-paraformer-zh-2023-09-14/test_wavs/0.wav" if not Path(model).is_file(): print("skipping test_paraformer_single_file()") @@ -157,15 +157,15 @@ def test_paraformer_single_file(self): def test_paraformer_multiple_files(self): for use_int8 in [True, False]: if use_int8: - model = f"{d}/sherpa-onnx-paraformer-zh-2023-04-19/model.int8.onnx" + model = f"{d}/sherpa-onnx-paraformer-zh-2023-09-14/model.int8.onnx" else: - model = f"{d}/sherpa-onnx-paraformer-zh-2023-04-19/model.onnx" + model = f"{d}/sherpa-onnx-paraformer-zh-2023-09-14/model.onnx" - tokens = f"{d}/sherpa-onnx-paraformer-zh-2023-04-19/tokens.txt" - wave0 = f"{d}/sherpa-onnx-paraformer-zh-2023-04-19/test_wavs/0.wav" - wave1 = f"{d}/sherpa-onnx-paraformer-zh-2023-04-19/test_wavs/1.wav" - wave2 = f"{d}/sherpa-onnx-paraformer-zh-2023-04-19/test_wavs/2.wav" - wave3 = f"{d}/sherpa-onnx-paraformer-zh-2023-04-19/test_wavs/8k.wav" + tokens = f"{d}/sherpa-onnx-paraformer-zh-2023-09-14/tokens.txt" + wave0 = f"{d}/sherpa-onnx-paraformer-zh-2023-09-14/test_wavs/0.wav" + wave1 = f"{d}/sherpa-onnx-paraformer-zh-2023-09-14/test_wavs/1.wav" + wave2 = f"{d}/sherpa-onnx-paraformer-zh-2023-09-14/test_wavs/2.wav" + wave3 = f"{d}/sherpa-onnx-paraformer-zh-2023-09-14/test_wavs/8k.wav" if not Path(model).is_file(): print("skipping test_paraformer_multiple_files()")