From 01814c12b15cb8710da84bfe852e7267d4562530 Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Fri, 16 Aug 2024 10:07:06 +0800 Subject: [PATCH 1/5] add a zipformer reazonspeech japanese model for generating subtitles --- .github/workflows/lazarus.yaml | 2 ++ scripts/lazarus/generate-subtitles.py | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/.github/workflows/lazarus.yaml b/.github/workflows/lazarus.yaml index 2b2bf8980..3a8b93220 100644 --- a/.github/workflows/lazarus.yaml +++ b/.github/workflows/lazarus.yaml @@ -4,6 +4,8 @@ on: push: branches: - master + - lazarus + - lazarus-more-models paths: - '.github/workflows/lazarus.yaml' - 'CMakeLists.txt' diff --git a/scripts/lazarus/generate-subtitles.py b/scripts/lazarus/generate-subtitles.py index 608d7e9d6..cc80e72b8 100755 --- a/scripts/lazarus/generate-subtitles.py +++ b/scripts/lazarus/generate-subtitles.py @@ -123,6 +123,23 @@ def get_models(): ls -lh + popd + """, + ), + Model( + model_name="sherpa-onnx-zipformer-ja-reazonspeech-2024-08-01", + lang="ja", + short_name="zipformer_reazonspeech_2024_08_01", + cmd=""" + pushd $model_name + mv encoder-epoch-99-avg-1.int8.onnx transducer-encoder.onnx + mv decoder-epoch-99-avg-1.onnx transducer-decoder.onnx + mv joiner-epoch-99-avg-1.int8.onnx transducer-joiner.onnx + + rm -fv encoder-epoch-99-avg-1.onnx + rm -fv decoder-epoch-99-avg-1.int8.onnx + rm -fv joiner-epoch-99-avg-1.onnx + popd """, ), From 4983528df24b80d2c9b79d4c25c265fccb63e3f9 Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Fri, 16 Aug 2024 11:27:07 +0800 Subject: [PATCH 2/5] add a model for Thai --- .github/workflows/lazarus.yaml | 1 + scripts/lazarus/generate-subtitles.py | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/.github/workflows/lazarus.yaml b/.github/workflows/lazarus.yaml index 3a8b93220..8711a0a7c 100644 --- a/.github/workflows/lazarus.yaml +++ b/.github/workflows/lazarus.yaml @@ -14,6 +14,7 @@ on: - 'sherpa-onnx/csrc/*' - 'sherpa-onnx/c-api/*' - 'sherpa-onnx/pascal-api/*' + - 'scripts/lazarus/*' pull_request: branches: - master diff --git a/scripts/lazarus/generate-subtitles.py b/scripts/lazarus/generate-subtitles.py index cc80e72b8..1d17fac09 100755 --- a/scripts/lazarus/generate-subtitles.py +++ b/scripts/lazarus/generate-subtitles.py @@ -140,6 +140,30 @@ def get_models(): rm -fv decoder-epoch-99-avg-1.int8.onnx rm -fv joiner-epoch-99-avg-1.onnx + popd + """, + ), + Model( + model_name="sherpa-onnx-zipformer-thai-2024-06-20", + lang="th", + short_name="zipformer_gigaspeech2", + cmd=""" + pushd $model_name + + rm -rfv test_wavs + rm -fv README.md + rm -fv bpe.model + + mv encoder-epoch-12-avg-5.int8.onnx transducer-encoder.onnx + mv decoder-epoch-12-avg-5.onnx transducer-decoder.onnx + mv joiner-epoch-12-avg-5.int8.onnx transducer-joiner.onnx + + rm -fv encoder-epoch-12-avg-5.onnx + rm -fv decoder-epoch-12-avg-5.int8.onnx + rm -fv joiner-epoch-12-avg-5.onnx + + ls -lh + popd """, ), From 9c0efaed743d0319f9195520878cc3dfc4c0e5aa Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Fri, 16 Aug 2024 13:51:17 +0800 Subject: [PATCH 3/5] fix a typo for building flutter tts --- scripts/flutter/generate-tts.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/flutter/generate-tts.py b/scripts/flutter/generate-tts.py index 4b5f8d5d0..380d1f453 100755 --- a/scripts/flutter/generate-tts.py +++ b/scripts/flutter/generate-tts.py @@ -342,7 +342,6 @@ def get_vits_models() -> List[TtsModel]: or "sherpa-onnx-vits-zh-ll" == m.model_dir or "melo-tts" in m.model_dir ): - s = s[:-1] m.dict_dir = m.model_dir + "/dict" else: m.rule_fars = f"{m.model_dir}/rule.far" From 8b10c1d89446b69a1daf59caed4ef468b5209ab7 Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Fri, 16 Aug 2024 18:34:10 +0800 Subject: [PATCH 4/5] update readme --- lazarus-examples/README.md | 8 ++++++++ lazarus-examples/generate_subtitles/README.md | 9 +++++++++ pascal-api-examples/README.md | 3 +++ scripts/lazarus/generate-subtitles.py | 15 +++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 lazarus-examples/README.md create mode 100644 lazarus-examples/generate_subtitles/README.md diff --git a/lazarus-examples/README.md b/lazarus-examples/README.md new file mode 100644 index 000000000..21bc28db9 --- /dev/null +++ b/lazarus-examples/README.md @@ -0,0 +1,8 @@ +# Introduction + +This directory contains examples about using +https://www.lazarus-ide.org/ +with Object Pascal API to develop speech related applications. + +**Documentation for this directory**: +https://k2-fsa.github.io/sherpa/onnx/lazarus/index.html diff --git a/lazarus-examples/generate_subtitles/README.md b/lazarus-examples/generate_subtitles/README.md new file mode 100644 index 000000000..a3eb665ba --- /dev/null +++ b/lazarus-examples/generate_subtitles/README.md @@ -0,0 +1,9 @@ +# Introduction + +Please refer to +https://k2-fsa.github.io/sherpa/onnx/lazarus/generate-subtitles.html +for how to build the project in this directory. + +You can find pre-built APPs from this directory at +https://k2-fsa.github.io/sherpa/onnx/lazarus/pre-built-app.html + diff --git a/pascal-api-examples/README.md b/pascal-api-examples/README.md index 76d5dfd37..ffbf8e9ef 100644 --- a/pascal-api-examples/README.md +++ b/pascal-api-examples/README.md @@ -3,6 +3,9 @@ This directory contains examples for how to use the [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) APIs of [sherpa-onnx](https://github.com/k2-fsa/sherpa-onnx). +**Documentation for this directory**: +https://k2-fsa.github.io/sherpa/onnx/pascal-api/index.html + |Directory| Description| |---------|------------| |[read-wav](./read-wav)|It shows how to read a wave file.| diff --git a/scripts/lazarus/generate-subtitles.py b/scripts/lazarus/generate-subtitles.py index 1d17fac09..6459886c1 100755 --- a/scripts/lazarus/generate-subtitles.py +++ b/scripts/lazarus/generate-subtitles.py @@ -164,6 +164,21 @@ def get_models(): ls -lh + popd + """, + ), + Model( + model_name="sherpa-onnx-telespeech-ctc-int8-zh-2024-06-04", + lang="zh", + short_name="telespeech_ctc", + cmd=""" + pushd $model_name + + mv model.int8.onnx telespeech.onnx + rm -fv model.onnx + + ls -lh + popd """, ), From 468f08ef32ea33b7c215b0aec362f5a43f8dbcdd Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Fri, 16 Aug 2024 20:05:37 +0800 Subject: [PATCH 5/5] Update README to include object pascal and lazarus --- .github/workflows/lazarus.yaml | 2 +- README.md | 31 ++++++++++++++++++++----------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/lazarus.yaml b/.github/workflows/lazarus.yaml index 8711a0a7c..11df53644 100644 --- a/.github/workflows/lazarus.yaml +++ b/.github/workflows/lazarus.yaml @@ -5,7 +5,6 @@ on: branches: - master - lazarus - - lazarus-more-models paths: - '.github/workflows/lazarus.yaml' - 'CMakeLists.txt' @@ -26,6 +25,7 @@ on: - 'sherpa-onnx/csrc/*' - 'sherpa-onnx/c-api/*' - 'sherpa-onnx/pascal-api/*' + - 'scripts/lazarus/*' workflow_dispatch: diff --git a/README.md b/README.md index 7951e7302..3590cc3aa 100644 --- a/README.md +++ b/README.md @@ -25,17 +25,17 @@ ### Supported programming languages -| 1. C++ | 2. C | 3. Python | 4. C# | 5. Java | -|--------|-------|-----------|-------|---------| -| ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| 1. C++ | 2. C | 3. Python | 4. JavaScript | +|--------|-------|-----------|---------------| +| ✔️ | ✔️ | ✔️ | ✔️ | -| 6. JavaScript | 7. Kotlin | 8. Swift | 9. Go | 10. Dart | -|---------------|-----------|----------|-------|----------| -| ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +|5. Java | 6. C# | 7. Kotlin | 8. Swift | +|--------|-------|-----------|----------| +| ✔️ | ✔️ | ✔️ | ✔️ | -| 11. Rust | 12. Pascal | -|----------|------------| -| ✔️ | ✔️ | +| 9. Go | 10. Dart | 11. Rust | 12. Pascal | +|-------|----------|----------|------------| +| ✔️ | ✔️ | ✔️ | ✔️ | For Rust support, please see https://github.com/thewh1teagle/sherpa-rs @@ -73,8 +73,8 @@ with the following APIs - C++, C, Python, Go, ``C#`` - Java, Kotlin, JavaScript - - Swift - - Dart + - Swift, Rust + - Dart, Object Pascal ### Links for pre-built Android APKs @@ -111,6 +111,15 @@ with the following APIs > Note: You need to build from source for iOS. +### Links for pre-built Lazarus APPs + +#### Generating subtitles + +| Description | URL | 中国用户 | +|--------------------------------|---------------------------------------------------------------------|---------------------------------------------------------------------| +| Generate subtitles (生成字幕) | [Address](https://k2-fsa.github.io/sherpa/onnx/lazarus/download-generated-subtitles.html)| [点此](https://k2-fsa.github.io/sherpa/onnx/lazarus/download-generated-subtitles-cn.html)| + + ### Links for pre-trained models | Description | URL |