Fangjun Kuang
Committed by GitHub

Build generating subtitles APPs for more models (#1265)

@@ -4,6 +4,7 @@ on: @@ -4,6 +4,7 @@ on:
4 push: 4 push:
5 branches: 5 branches:
6 - master 6 - master
  7 + - lazarus
7 paths: 8 paths:
8 - '.github/workflows/lazarus.yaml' 9 - '.github/workflows/lazarus.yaml'
9 - 'CMakeLists.txt' 10 - 'CMakeLists.txt'
@@ -12,6 +13,7 @@ on: @@ -12,6 +13,7 @@ on:
12 - 'sherpa-onnx/csrc/*' 13 - 'sherpa-onnx/csrc/*'
13 - 'sherpa-onnx/c-api/*' 14 - 'sherpa-onnx/c-api/*'
14 - 'sherpa-onnx/pascal-api/*' 15 - 'sherpa-onnx/pascal-api/*'
  16 + - 'scripts/lazarus/*'
15 pull_request: 17 pull_request:
16 branches: 18 branches:
17 - master 19 - master
@@ -23,6 +25,7 @@ on: @@ -23,6 +25,7 @@ on:
23 - 'sherpa-onnx/csrc/*' 25 - 'sherpa-onnx/csrc/*'
24 - 'sherpa-onnx/c-api/*' 26 - 'sherpa-onnx/c-api/*'
25 - 'sherpa-onnx/pascal-api/*' 27 - 'sherpa-onnx/pascal-api/*'
  28 + - 'scripts/lazarus/*'
26 29
27 workflow_dispatch: 30 workflow_dispatch:
28 31
@@ -25,17 +25,17 @@ @@ -25,17 +25,17 @@
25 25
26 ### Supported programming languages 26 ### Supported programming languages
27 27
28 -| 1. C++ | 2. C | 3. Python | 4. C# | 5. Java |  
29 -|--------|-------|-----------|-------|---------|  
30 -| ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | 28 +| 1. C++ | 2. C | 3. Python | 4. JavaScript |
  29 +|--------|-------|-----------|---------------|
  30 +| ✔️ | ✔️ | ✔️ | ✔️ |
31 31
32 -| 6. JavaScript | 7. Kotlin | 8. Swift | 9. Go | 10. Dart |  
33 -|---------------|-----------|----------|-------|----------|  
34 -| ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | 32 +|5. Java | 6. C# | 7. Kotlin | 8. Swift |
  33 +|--------|-------|-----------|----------|
  34 +| ✔️ | ✔️ | ✔️ | ✔️ |
35 35
36 -| 11. Rust | 12. Pascal |  
37 -|----------|------------|  
38 -| ✔️ | ✔️ | 36 +| 9. Go | 10. Dart | 11. Rust | 12. Pascal |
  37 +|-------|----------|----------|------------|
  38 +| ✔️ | ✔️ | ✔️ | ✔️ |
39 39
40 For Rust support, please see https://github.com/thewh1teagle/sherpa-rs 40 For Rust support, please see https://github.com/thewh1teagle/sherpa-rs
41 41
@@ -73,8 +73,8 @@ with the following APIs @@ -73,8 +73,8 @@ with the following APIs
73 73
74 - C++, C, Python, Go, ``C#`` 74 - C++, C, Python, Go, ``C#``
75 - Java, Kotlin, JavaScript 75 - Java, Kotlin, JavaScript
76 - - Swift  
77 - - Dart 76 + - Swift, Rust
  77 + - Dart, Object Pascal
78 78
79 ### Links for pre-built Android APKs 79 ### Links for pre-built Android APKs
80 80
@@ -111,6 +111,15 @@ with the following APIs @@ -111,6 +111,15 @@ with the following APIs
111 111
112 > Note: You need to build from source for iOS. 112 > Note: You need to build from source for iOS.
113 113
  114 +### Links for pre-built Lazarus APPs
  115 +
  116 +#### Generating subtitles
  117 +
  118 +| Description | URL | 中国用户 |
  119 +|--------------------------------|---------------------------------------------------------------------|---------------------------------------------------------------------|
  120 +| 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)|
  121 +
  122 +
114 ### Links for pre-trained models 123 ### Links for pre-trained models
115 124
116 | Description | URL | 125 | Description | URL |
  1 +# Introduction
  2 +
  3 +This directory contains examples about using
  4 +https://www.lazarus-ide.org/
  5 +with Object Pascal API to develop speech related applications.
  6 +
  7 +**Documentation for this directory**:
  8 +https://k2-fsa.github.io/sherpa/onnx/lazarus/index.html
  1 +# Introduction
  2 +
  3 +Please refer to
  4 +https://k2-fsa.github.io/sherpa/onnx/lazarus/generate-subtitles.html
  5 +for how to build the project in this directory.
  6 +
  7 +You can find pre-built APPs from this directory at
  8 +https://k2-fsa.github.io/sherpa/onnx/lazarus/pre-built-app.html
  9 +
@@ -3,6 +3,9 @@ @@ -3,6 +3,9 @@
3 This directory contains examples for how to use the [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal) 3 This directory contains examples for how to use the [Object Pascal](https://en.wikipedia.org/wiki/Object_Pascal)
4 APIs of [sherpa-onnx](https://github.com/k2-fsa/sherpa-onnx). 4 APIs of [sherpa-onnx](https://github.com/k2-fsa/sherpa-onnx).
5 5
  6 +**Documentation for this directory**:
  7 +https://k2-fsa.github.io/sherpa/onnx/pascal-api/index.html
  8 +
6 |Directory| Description| 9 |Directory| Description|
7 |---------|------------| 10 |---------|------------|
8 |[read-wav](./read-wav)|It shows how to read a wave file.| 11 |[read-wav](./read-wav)|It shows how to read a wave file.|
@@ -342,7 +342,6 @@ def get_vits_models() -> List[TtsModel]: @@ -342,7 +342,6 @@ def get_vits_models() -> List[TtsModel]:
342 or "sherpa-onnx-vits-zh-ll" == m.model_dir 342 or "sherpa-onnx-vits-zh-ll" == m.model_dir
343 or "melo-tts" in m.model_dir 343 or "melo-tts" in m.model_dir
344 ): 344 ):
345 - s = s[:-1]  
346 m.dict_dir = m.model_dir + "/dict" 345 m.dict_dir = m.model_dir + "/dict"
347 else: 346 else:
348 m.rule_fars = f"{m.model_dir}/rule.far" 347 m.rule_fars = f"{m.model_dir}/rule.far"
@@ -126,6 +126,62 @@ def get_models(): @@ -126,6 +126,62 @@ def get_models():
126 popd 126 popd
127 """, 127 """,
128 ), 128 ),
  129 + Model(
  130 + model_name="sherpa-onnx-zipformer-ja-reazonspeech-2024-08-01",
  131 + lang="ja",
  132 + short_name="zipformer_reazonspeech_2024_08_01",
  133 + cmd="""
  134 + pushd $model_name
  135 + mv encoder-epoch-99-avg-1.int8.onnx transducer-encoder.onnx
  136 + mv decoder-epoch-99-avg-1.onnx transducer-decoder.onnx
  137 + mv joiner-epoch-99-avg-1.int8.onnx transducer-joiner.onnx
  138 +
  139 + rm -fv encoder-epoch-99-avg-1.onnx
  140 + rm -fv decoder-epoch-99-avg-1.int8.onnx
  141 + rm -fv joiner-epoch-99-avg-1.onnx
  142 +
  143 + popd
  144 + """,
  145 + ),
  146 + Model(
  147 + model_name="sherpa-onnx-zipformer-thai-2024-06-20",
  148 + lang="th",
  149 + short_name="zipformer_gigaspeech2",
  150 + cmd="""
  151 + pushd $model_name
  152 +
  153 + rm -rfv test_wavs
  154 + rm -fv README.md
  155 + rm -fv bpe.model
  156 +
  157 + mv encoder-epoch-12-avg-5.int8.onnx transducer-encoder.onnx
  158 + mv decoder-epoch-12-avg-5.onnx transducer-decoder.onnx
  159 + mv joiner-epoch-12-avg-5.int8.onnx transducer-joiner.onnx
  160 +
  161 + rm -fv encoder-epoch-12-avg-5.onnx
  162 + rm -fv decoder-epoch-12-avg-5.int8.onnx
  163 + rm -fv joiner-epoch-12-avg-5.onnx
  164 +
  165 + ls -lh
  166 +
  167 + popd
  168 + """,
  169 + ),
  170 + Model(
  171 + model_name="sherpa-onnx-telespeech-ctc-int8-zh-2024-06-04",
  172 + lang="zh",
  173 + short_name="telespeech_ctc",
  174 + cmd="""
  175 + pushd $model_name
  176 +
  177 + mv model.int8.onnx telespeech.onnx
  178 + rm -fv model.onnx
  179 +
  180 + ls -lh
  181 +
  182 + popd
  183 + """,
  184 + ),
129 ] 185 ]
130 return models 186 return models
131 187