csukuangfj commited on
Commit
3a556c6
1 Parent(s): fb72693

html for kws

Browse files
generate-asr-2pass.py CHANGED
@@ -61,8 +61,8 @@ def get_all_files(d: str, suffix: str) -> List[str]:
61
 
62
  def to_file(filename: str, files: List[str]):
63
  content = r"""
64
- <h1> APKs for streaming speech recognition </h1>
65
- This page lists the <strong>streaming speech recognition</strong> APKs for <a href="http://github.com/k2-fsa/sherpa-onnx">sherpa-onnx</a>,
66
  one of the deployment frameworks of <a href="https://github.com/k2-fsa">the Next-gen Kaldi project</a>.
67
  <br/>
68
  The name of an APK has the following rule:
@@ -79,6 +79,38 @@ where
79
 
80
  <br/>
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  You can download all supported models from
83
  <a href="https://github.com/k2-fsa/sherpa-onnx/releases/tag/asr-models">https://github.com/k2-fsa/sherpa-onnx/releases/tag/asr-models</a>
84
 
 
61
 
62
  def to_file(filename: str, files: List[str]):
63
  content = r"""
64
+ <h1> APKs for two-pass speech recognition </h1>
65
+ This page lists the <strong>two-pass speech recognition</strong> APKs for <a href="http://github.com/k2-fsa/sherpa-onnx">sherpa-onnx</a>,
66
  one of the deployment frameworks of <a href="https://github.com/k2-fsa">the Next-gen Kaldi project</a>.
67
  <br/>
68
  The name of an APK has the following rule:
 
79
 
80
  <br/>
81
 
82
+ <span style="color:red;">Two-pass:</span> Two models are used during the recognition. A streaming model
83
+ is used in the first pass, while a non-streaming model is used in the second pass. The purpose
84
+ of the first pass is to give feedback to users that the system is working and it displays results while
85
+ users are speaking. When an endpoint is detected, the samples between two endpoints are sent to the second
86
+ pass model for recognition. The output of the second pass model is the final recognition result.
87
+
88
+ <br/>
89
+ <br/>
90
+
91
+ <span style="color:red;">Features of the first-pass model:</span>
92
+ <ul>
93
+ <li> A streaming model
94
+ <li> Low latency
95
+ <li> Small in model size
96
+ <li> Runs very fast
97
+ <li> Low accuracy
98
+ </ul>
99
+
100
+ <br/>
101
+
102
+ <span style="color:red;">Features of the second-pass model:</span>
103
+ <ul>
104
+ <li> A non-streaming model
105
+ <li> High latency
106
+ <li> Large in model size
107
+ <li> Runs a bit slow
108
+ <li> High accuracy
109
+ </ul>
110
+
111
+ <br/>
112
+ <br/>
113
+
114
  You can download all supported models from
115
  <a href="https://github.com/k2-fsa/sherpa-onnx/releases/tag/asr-models">https://github.com/k2-fsa/sherpa-onnx/releases/tag/asr-models</a>
116
 
generate-asr.py CHANGED
@@ -103,40 +103,34 @@ see https://www.tablesgenerator.com/html_tables#
103
  <tr>
104
  <th class="tg-0pky">APK</th>
105
  <th class="tg-0lax">Comment</th>
106
- <th class="tg-0pky">Model Name</th>
107
- <th class="tg-0pky">Model Link</th>
108
  </tr>
109
  </thead>
110
  <tbody>
111
  <tr>
112
  <td class="tg-0pky">sherpa-onnx-x.y.z-arm64-v8a-asr-bilingual_zh_en-zipformer.apk</td>
113
  <td class="tg-0lax">It supports both English and Chinese.</td>
114
- <td class="tg-0pky">sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20</td>
115
- <td class="tg-0pky"><a href="https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2">https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2</a></td>
116
  </tr>
117
  <tr>
118
  <td class="tg-0pky">sherpa-onnx-x.y.z-arm64-v8a-asr-fr-zipformer.apk</td>
119
  <td class="tg-0lax"><span style="font-weight:400;font-style:normal">It supports only French.</span></td>
120
- <td class="tg-0pky">sherpa-onnx-streaming-zipformer-fr-2023-04-14</td>
121
- <td class="tg-0pky"><a href="https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-fr-2023-04-14.tar.bz2">https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-fr-2023-04-14.tar.bz2</a></td>
122
  </tr>
123
  <tr>
124
  <td class="tg-0pky">sherpa-onnx-x.y.z-arm64-v8a-asr-zh-zipformer2.apk</td>
125
  <td class="tg-0lax">It supports only Chinese.</td>
126
- <td class="tg-0pky">icefall-asr-zipformer-streaming-wenetspeech-20230615</td>
127
- <td class="tg-0pky"><a href="https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/icefall-asr-zipformer-streaming-wenetspeech-20230615.tar.bz2">https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/icefall-asr-zipformer-streaming-wenetspeech-20230615.tar.bz2</a></td>
128
  </tr>
129
  <tr>
130
- <td class="tg-0pky">sherpa-onnx-x.y.z-arm64-v8a-asr-zh-small_zipformer.apk</td>
131
  <td class="tg-0lax">It supports only Chinese.<br>It uses the smallest zipformer and runs<br>super fast, though its accuracy is not that good.</td>
132
- <td class="tg-0pky">sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23</td>
133
- <td class="tg-0pky"><a href="https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23.tar.bz2">https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23.tar.bz2</a></td>
134
  </tr>
135
  <tr>
136
  <td class="tg-0pky">sherpa-onnx-x.y.z-arm64-v8a-asr-en-small_zipformer.apk</td>
137
  <td class="tg-0lax">It suppors only English.<br>It uses a very small zipformer and runs<br>super fast, though its accuracy is not that good.</td>
138
- <td class="tg-0pky">sherpa-onnx-streaming-zipformer-en-20M-2023-02-17</td>
139
- <td class="tg-0pky"><a href="https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-en-20M-2023-02-17.tar.bz2">https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-en-20M-2023-02-17.tar.bz2</a></td>
140
  </tr>
141
  </tbody>
142
  </table>
 
103
  <tr>
104
  <th class="tg-0pky">APK</th>
105
  <th class="tg-0lax">Comment</th>
106
+ <th class="tg-0pky">Model</th>
 
107
  </tr>
108
  </thead>
109
  <tbody>
110
  <tr>
111
  <td class="tg-0pky">sherpa-onnx-x.y.z-arm64-v8a-asr-bilingual_zh_en-zipformer.apk</td>
112
  <td class="tg-0lax">It supports both English and Chinese.</td>
113
+ <td class="tg-0pky"><a href="https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2">sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2</a></td>
 
114
  </tr>
115
  <tr>
116
  <td class="tg-0pky">sherpa-onnx-x.y.z-arm64-v8a-asr-fr-zipformer.apk</td>
117
  <td class="tg-0lax"><span style="font-weight:400;font-style:normal">It supports only French.</span></td>
118
+ <td class="tg-0pky"><a href="https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-fr-2023-04-14.tar.bz2">sherpa-onnx-streaming-zipformer-fr-2023-04-14.tar.bz2</a></td>
 
119
  </tr>
120
  <tr>
121
  <td class="tg-0pky">sherpa-onnx-x.y.z-arm64-v8a-asr-zh-zipformer2.apk</td>
122
  <td class="tg-0lax">It supports only Chinese.</td>
123
+ <td class="tg-0pky"><a href="https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/icefall-asr-zipformer-streaming-wenetspeech-20230615.tar.bz2">icefall-asr-zipformer-streaming-wenetspeech-20230615.tar.bz2</a></td>
 
124
  </tr>
125
  <tr>
126
+ <td class="tg-0pky">sherpa-onnx-x.y.zz-arm64-v8a-asr-zh-small_zipformer.apk</td>
127
  <td class="tg-0lax">It supports only Chinese.<br>It uses the smallest zipformer and runs<br>super fast, though its accuracy is not that good.</td>
128
+ <td class="tg-0pky"><a href="https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23.tar.bz2">sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23.tar.bz2</a></td>
 
129
  </tr>
130
  <tr>
131
  <td class="tg-0pky">sherpa-onnx-x.y.z-arm64-v8a-asr-en-small_zipformer.apk</td>
132
  <td class="tg-0lax">It suppors only English.<br>It uses a very small zipformer and runs<br>super fast, though its accuracy is not that good.</td>
133
+ <td class="tg-0pky"><a href="https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-en-20M-2023-02-17.tar.bz2">sherpa-onnx-streaming-zipformer-en-20M-2023-02-17.tar.bz2</a></td>
 
134
  </tr>
135
  </tbody>
136
  </table>
generate-kws.py ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ import os
3
+ import re
4
+ from pathlib import Path
5
+ from typing import List
6
+
7
+ BASE_URL = "https://huggingface.co/csukuangfj/sherpa-onnx-apk/resolve/main/"
8
+
9
+ from dataclasses import dataclass
10
+
11
+
12
+ @dataclass
13
+ class APK:
14
+ major: int
15
+ minor: int
16
+ patch: int
17
+ arch: str
18
+ short_name: str
19
+
20
+ def __init__(self, s):
21
+ # sherpa-onnx-1.9.23-arm64-v8a-kws-en-gigaspeech-zipformer.apk
22
+ # sherpa-onnx-1.9.23-x86-kws-en-gigaspeech-zipformer.apk
23
+ s = str(s)[len("asr/") :]
24
+ split = s.split("-")
25
+ self.major, self.minor, self.patch = list(map(int, split[2].split(".")))
26
+ self.arch = split[3]
27
+ self.lang = split[5]
28
+ self.short_name = split[6] + split[7]
29
+ if "arm" in s:
30
+ self.arch += "-" + split[4]
31
+ self.lang = split[6]
32
+ self.short_name = split[7] + split[8]
33
+
34
+ if "armeabi" in self.arch:
35
+ self.arch = "y" + self.arch
36
+
37
+ if "arm64" in self.arch:
38
+ self.arch = "z" + self.arch
39
+
40
+
41
+ def sort_by_apk(x):
42
+ x = APK(x)
43
+ return (x.major, x.minor, x.patch, x.arch, x.lang, x.short_name)
44
+
45
+
46
+ def generate_url(files: List[str]) -> List[str]:
47
+ ans = []
48
+ base = BASE_URL
49
+ for f in files:
50
+ ans.append(base + str(f))
51
+ return ans
52
+
53
+
54
+ def get_all_files(d: str, suffix: str) -> List[str]:
55
+ ans = sorted(Path(d).glob(suffix), key=sort_by_apk, reverse=True)
56
+ return list(map(lambda x: BASE_URL + str(x), ans))
57
+
58
+
59
+ def to_file(filename: str, files: List[str]):
60
+ content = r"""
61
+ <h1> APKs for keyword spotting </h1>
62
+ This page lists the <strong>keyword spotting</strong> APKs for <a href="http://github.com/k2-fsa/sherpa-onnx">sherpa-onnx</a>,
63
+ one of the deployment frameworks of <a href="https://github.com/k2-fsa">the Next-gen Kaldi project</a>.
64
+ <br/>
65
+ The name of an APK has the following rule:
66
+ <ul>
67
+ <li> sherpa-onnx-{version}-{arch}-kws-${lang}-{dataset}-{model}.apk
68
+ </ul>
69
+ where
70
+ <ul>
71
+ <li> version: It specifies the current version, e.g., 1.9.23
72
+ <li> arch: The architecture targeted by this APK, e.g., arm64-v8a, armeabi-v7a, x86_64, x86
73
+ <li> lang: The lang of the model used in the APK, e.g., en for English, zh for Chinese
74
+ <li> dataset: The dataset used to train the model
75
+ <li> model: The name of the model used in the APK
76
+ </ul>
77
+
78
+ <br/>
79
+
80
+ You can download all supported models from
81
+ <a href="https://github.com/k2-fsa/sherpa-onnx/releases/tag/kws-models">https://github.com/k2-fsa/sherpa-onnx/releases/tag/kws-models</a>
82
+
83
+ <br/>
84
+ <br/>
85
+
86
+ <!--
87
+ see https://www.tablesgenerator.com/html_tables#
88
+ -->
89
+
90
+ <style type="text/css">
91
+ .tg {border-collapse:collapse;border-spacing:0;}
92
+ .tg td{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
93
+ overflow:hidden;padding:10px 5px;word-break:normal;}
94
+ .tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
95
+ font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;}
96
+ .tg .tg-0pky{border-color:inherit;text-align:left;vertical-align:top}
97
+ .tg .tg-0lax{text-align:left;vertical-align:top}
98
+ </style>
99
+ <table class="tg">
100
+ <thead>
101
+ <tr>
102
+ <th class="tg-0pky">APK</th>
103
+ <th class="tg-0lax">Comment</th>
104
+ <th class="tg-0pky">Model</th>
105
+ </tr>
106
+ </thead>
107
+ <tbody>
108
+ <tr>
109
+ <td class="tg-0pky">sherpa-onnx-x.y.z-arm64-v8a-kws-zh-wenetspeech-zipformer.apk</td>
110
+ <td class="tg-0lax">It supports only Chinese.</td>
111
+ <td class="tg-0pky"><a href="https://github.com/k2-fsa/sherpa-onnx/releases/download/kws-models/sherpa-onnx-kws-zipformer-gigaspeech-3.3M-2024-01-01.tar.bz2">sherpa-onnx-kws-zipformer-gigaspeech-3.3M-2024-01-01.tar.bz2</a></td>
112
+ </tr>
113
+ <tr>
114
+ <td class="tg-0pky">sherpa-onnx-x.y.z-arm64-v8a-kws-en-gigaspeech-zipformer.apk</td>
115
+ <td class="tg-0lax">It supports only English.</td>
116
+ <td class="tg-0pky"><a href="https://github.com/k2-fsa/sherpa-onnx/releases/download/kws-models/sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01.tar.bz2">sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01.tar.bz2</a></td>
117
+ </tr>
118
+ </tbody>
119
+ </table>
120
+
121
+ <br/>
122
+ <br/>
123
+
124
+ <div/>
125
+ """
126
+ if "-cn" not in filename:
127
+ content += """
128
+ For Chinese users, please <a href="./apk-cn.html">visit this address</a>,
129
+ which replaces <a href="huggingface.co">huggingface.co</a> with <a href="hf-mirror.com">hf-mirror.com</a>
130
+ <br/>
131
+ <br/>
132
+ 中国用户, 请访问<a href="./apk-cn.html">这个地址</a>
133
+ <br/>
134
+ <br/>
135
+ """
136
+
137
+ with open(filename, "w") as f:
138
+ print(content, file=f)
139
+ for x in files:
140
+ name = x.rsplit("/", maxsplit=1)[-1]
141
+ print(f'<a href="{x}" />{name}<br/>', file=f)
142
+
143
+
144
+ def main():
145
+ apk = get_all_files("kws", suffix="*.apk")
146
+ to_file("./apk-kws.html", apk)
147
+
148
+ # for Chinese users
149
+ apk2 = []
150
+ for a in apk:
151
+ a = a.replace("huggingface.co", "hf-mirror.com")
152
+ apk2.append(a)
153
+
154
+ to_file("./apk-kws-cn.html", apk2)
155
+
156
+
157
+ if __name__ == "__main__":
158
+ main()
generate-vad-asr.py ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ import os
3
+ import re
4
+ from pathlib import Path
5
+ from typing import List
6
+
7
+ BASE_URL = "https://huggingface.co/csukuangfj/sherpa-onnx-apk/resolve/main/"
8
+
9
+ from dataclasses import dataclass
10
+
11
+
12
+ @dataclass
13
+ class APK:
14
+ major: int
15
+ minor: int
16
+ patch: int
17
+ arch: str
18
+ short_name: str
19
+
20
+ def __init__(self, s):
21
+ # sherpa-onnx-1.9.23-arm64-v8a-vad_asr-en-whisper_tiny.apk
22
+ # sherpa-onnx-1.9.23-x86-vad_asr-en-whisper_tiny.apk
23
+ s = str(s)[len("vad-asr/") :]
24
+ split = s.split("-")
25
+ self.major, self.minor, self.patch = list(map(int, split[2].split(".")))
26
+ self.arch = split[3]
27
+ self.lang = split[5]
28
+ self.short_name = split[6]
29
+ if "arm" in s:
30
+ self.arch += "-" + split[4]
31
+ self.lang = split[6]
32
+ self.short_name = split[7]
33
+
34
+ if "armeabi" in self.arch:
35
+ self.arch = "y" + self.arch
36
+
37
+ if "arm64" in self.arch:
38
+ self.arch = "z" + self.arch
39
+
40
+ if "small" in self.short_name:
41
+ self.short_name = "zzz" + self.short_name
42
+
43
+
44
+ def sort_by_apk(x):
45
+ x = APK(x)
46
+ return (x.major, x.minor, x.patch, x.arch, x.lang, x.short_name)
47
+
48
+
49
+ def generate_url(files: List[str]) -> List[str]:
50
+ ans = []
51
+ base = BASE_URL
52
+ for f in files:
53
+ ans.append(base + str(f))
54
+ return ans
55
+
56
+
57
+ def get_all_files(d: str, suffix: str) -> List[str]:
58
+ ans = sorted(Path(d).glob(suffix), key=sort_by_apk, reverse=True)
59
+ return list(map(lambda x: BASE_URL + str(x), ans))
60
+
61
+
62
+ def to_file(filename: str, files: List[str]):
63
+ content = r"""
64
+ <h1> APKs for VAD + non-streaming speech recognition </h1>
65
+ This page lists the <strong>VAD + non-streaming speech recognition</strong> APKs for <a href="http://github.com/k2-fsa/sherpa-onnx">sherpa-onnx</a>,
66
+ one of the deployment frameworks of <a href="https://github.com/k2-fsa">the Next-gen Kaldi project</a>.
67
+ <br/>
68
+ The name of an APK has the following rule:
69
+ <ul>
70
+ <li> sherpa-onnx-{version}-{arch}-vad_asr-{lang}-{model}.apk
71
+ </ul>
72
+ where
73
+ <ul>
74
+ <li> version: It specifies the current version, e.g., 1.9.23
75
+ <li> arch: The architecture targeted by this APK, e.g., arm64-v8a, armeabi-v7a, x86_64, x86
76
+ <li> lang: The lang of the model used in the APK, e.g., en for English, zh for Chinese
77
+ <li> model: The name of the model used in the APK
78
+ </ul>
79
+
80
+ <br/>
81
+
82
+ You can download all supported models from
83
+ <a href="https://github.com/k2-fsa/sherpa-onnx/releases/tag/asr-models">https://github.com/k2-fsa/sherpa-onnx/releases/tag/asr-models</a>
84
+
85
+ <br/>
86
+ <br/>
87
+
88
+ <!--
89
+ see https://www.tablesgenerator.com/html_tables#
90
+ -->
91
+
92
+ <style type="text/css">
93
+ .tg {border-collapse:collapse;border-spacing:0;}
94
+ .tg td{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
95
+ overflow:hidden;padding:10px 5px;word-break:normal;}
96
+ .tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
97
+ font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;}
98
+ .tg .tg-0pky{border-color:inherit;text-align:left;vertical-align:top}
99
+ .tg .tg-0lax{text-align:left;vertical-align:top}
100
+ </style>
101
+ <table class="tg">
102
+ <thead>
103
+ <tr>
104
+ <th class="tg-0pky">APK</th>
105
+ <th class="tg-0lax">Comment</th>
106
+ <th class="tg-0pky">VAD model</th>
107
+ <th class="tg-0pky">Non-streaming ASR model</th>
108
+ </tr>
109
+ </thead>
110
+ <tbody>
111
+ <tr>
112
+ <td class="tg-0pky">sherpa-onnx-x.y.z-arm64-v8a-vad_asr-zh-zipformer.apk</td>
113
+ <td class="tg-0lax">It supports only Chinese.</td>
114
+ <td class="tg-0pky"><a href="https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/silero_vad.onnx">silero_vad.onnx</a></td>
115
+ <td class="tg-0pky"><a href="https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/icefall-asr-zipformer-wenetspeech-20230615.tar.bz2">icefall-asr-zipformer-wenetspeech-20230615</a></td>
116
+ </tr>
117
+ <tr>
118
+ <td class="tg-0pky">sherpa-onnx-x.y.z-arm64-v8a-vad_asr-zh-paraformer.apk</td>
119
+ <td class="tg-0lax"><span style="font-weight:400;font-style:normal">It supports both Chinese and English.</span></td>
120
+ <td class="tg-0pky"><a href="https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/silero_vad.onnx">silero_vad.onnx</a></td>
121
+ <td class="tg-0pky"><a href="https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-03-28.tar.bz2">sherpa-onnx-paraformer-zh-2023-03-28</a></td>
122
+ </tr>
123
+ <tr>
124
+ <td class="tg-0pky">sherpa-onnx-x.y.z-arm64-v8a-vad_asr-en-whisper_tiny.apk</td>
125
+ <td class="tg-0lax">It supports only English.</td>
126
+ <td class="tg-0pky"><a href="https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/silero_vad.onnx">silero_vad.onnx</a></td>
127
+ <td class="tg-0pky"><a href="https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-whisper-tiny.en.tar.bz2">sherpa-onnx-whisper-tiny.en</a></td>
128
+ </tr>
129
+ </tbody>
130
+ </table>
131
+
132
+ <br/>
133
+ <br/>
134
+
135
+ <div/>
136
+ """
137
+ if "-cn" not in filename:
138
+ content += """
139
+ For Chinese users, please <a href="./apk-vad-asr-cn.html">visit this address</a>,
140
+ which replaces <a href="huggingface.co">huggingface.co</a> with <a href="hf-mirror.com">hf-mirror.com</a>
141
+ <br/>
142
+ <br/>
143
+ 中国用户, 请访问<a href="./apk-vad-asr.cn.html">这个地址</a>
144
+ <br/>
145
+ <br/>
146
+ """
147
+
148
+ with open(filename, "w") as f:
149
+ print(content, file=f)
150
+ for x in files:
151
+ name = x.rsplit("/", maxsplit=1)[-1]
152
+ print(f'<a href="{x}" />{name}<br/>', file=f)
153
+
154
+
155
+ def main():
156
+ apk = get_all_files("vad-asr", suffix="*.apk")
157
+ to_file("./apk-vad-asr.html", apk)
158
+
159
+ # for Chinese users
160
+ apk2 = []
161
+ for a in apk:
162
+ a = a.replace("huggingface.co", "hf-mirror.com")
163
+ apk2.append(a)
164
+
165
+ to_file("./apk-vad-asr-cn.html", apk2)
166
+
167
+
168
+ if __name__ == "__main__":
169
+ main()
generate-vad.py ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ import os
3
+ import re
4
+ from pathlib import Path
5
+ from typing import List
6
+
7
+ BASE_URL = "https://huggingface.co/csukuangfj/sherpa-onnx-apk/resolve/main/"
8
+
9
+ from dataclasses import dataclass
10
+
11
+
12
+ @dataclass
13
+ class APK:
14
+ major: int
15
+ minor: int
16
+ patch: int
17
+ arch: str
18
+ short_name: str
19
+
20
+ def __init__(self, s):
21
+ # sherpa-onnx-1.9.23-arm64-v8a-silero_vad.apk
22
+ # sherpa-onnx-1.9.23-x86-silero_vad.apk
23
+ s = str(s)[len("asr/") :]
24
+ split = s.split("-")
25
+ self.major, self.minor, self.patch = list(map(int, split[2].split(".")))
26
+ self.arch = split[3]
27
+ self.short_name = split[4]
28
+ if "arm" in s:
29
+ self.arch += "-" + split[4]
30
+ self.short_name = split[5]
31
+
32
+ if "armeabi" in self.arch:
33
+ self.arch = "y" + self.arch
34
+
35
+ if "arm64" in self.arch:
36
+ self.arch = "z" + self.arch
37
+
38
+
39
+ def sort_by_apk(x):
40
+ x = APK(x)
41
+ return (x.major, x.minor, x.patch, x.arch, x.short_name)
42
+
43
+
44
+ def generate_url(files: List[str]) -> List[str]:
45
+ ans = []
46
+ base = BASE_URL
47
+ for f in files:
48
+ ans.append(base + str(f))
49
+ return ans
50
+
51
+
52
+ def get_all_files(d: str, suffix: str) -> List[str]:
53
+ ans = sorted(Path(d).glob(suffix), key=sort_by_apk, reverse=True)
54
+ return list(map(lambda x: BASE_URL + str(x), ans))
55
+
56
+
57
+ def to_file(filename: str, files: List[str]):
58
+ content = r"""
59
+ <h1> APKs for VAD </h1>
60
+ This page lists the <strong>VAD</strong> APKs for <a href="http://github.com/k2-fsa/sherpa-onnx">sherpa-onnx</a>,
61
+ one of the deployment frameworks of <a href="https://github.com/k2-fsa">the Next-gen Kaldi project</a>.
62
+ <br/>
63
+ The name of an APK has the following rule:
64
+ <ul>
65
+ <li> sherpa-onnx-{version}-{arch}-{model}.apk
66
+ </ul>
67
+ where
68
+ <ul>
69
+ <li> version: It specifies the current version, e.g., 1.9.23
70
+ <li> arch: The architecture targeted by this APK, e.g., arm64-v8a, armeabi-v7a, x86_64, x86
71
+ <li> model: The name of the model used in the APK
72
+ </ul>
73
+
74
+ <br/>
75
+
76
+ You can download all supported models from
77
+ <a href="https://github.com/k2-fsa/sherpa-onnx/releases/tag/asr-models">https://github.com/k2-fsa/sherpa-onnx/releases/tag/asr-models</a>
78
+
79
+ <br/>
80
+ <br/>
81
+
82
+ <!--
83
+ see https://www.tablesgenerator.com/html_tables#
84
+ -->
85
+
86
+ <style type="text/css">
87
+ .tg {border-collapse:collapse;border-spacing:0;}
88
+ .tg td{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
89
+ overflow:hidden;padding:10px 5px;word-break:normal;}
90
+ .tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
91
+ font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;}
92
+ .tg .tg-0pky{border-color:inherit;text-align:left;vertical-align:top}
93
+ .tg .tg-0lax{text-align:left;vertical-align:top}
94
+ </style>
95
+ <table class="tg">
96
+ <thead>
97
+ <tr>
98
+ <th class="tg-0pky">APK</th>
99
+ <th class="tg-0lax">Comment</th>
100
+ <th class="tg-0pky">Model</th>
101
+ </tr>
102
+ </thead>
103
+ <tbody>
104
+ <tr>
105
+ <td class="tg-0pky">sherpa-onnx-x.y.z-arm64-v8a-silero_vad.apk</td>
106
+ <td class="tg-0lax">It uses <a href="https://github.com/snakers4/silero-vad">https://github.com/snakers4/silero-vad</a></td>
107
+ <td class="tg-0pky"><a href="https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/silero_vad.onnx">silero_vad.onnx</a></td>
108
+ </tr>
109
+ </tbody>
110
+ </table>
111
+
112
+ <br/>
113
+ <br/>
114
+
115
+ <div/>
116
+ """
117
+ if "-cn" not in filename:
118
+ content += """
119
+ For Chinese users, please <a href="./apk-cn.html">visit this address</a>,
120
+ which replaces <a href="huggingface.co">huggingface.co</a> with <a href="hf-mirror.com">hf-mirror.com</a>
121
+ <br/>
122
+ <br/>
123
+ 中国用户, 请访问<a href="./apk-cn.html">这个地址</a>
124
+ <br/>
125
+ <br/>
126
+ """
127
+
128
+ with open(filename, "w") as f:
129
+ print(content, file=f)
130
+ for x in files:
131
+ name = x.rsplit("/", maxsplit=1)[-1]
132
+ print(f'<a href="{x}" />{name}<br/>', file=f)
133
+
134
+
135
+ def main():
136
+ apk = get_all_files("vad", suffix="*.apk")
137
+ to_file("./apk-vad.html", apk)
138
+
139
+ # for Chinese users
140
+ apk2 = []
141
+ for a in apk:
142
+ a = a.replace("huggingface.co", "hf-mirror.com")
143
+ apk2.append(a)
144
+
145
+ to_file("./apk-vad-cn.html", apk2)
146
+
147
+
148
+ if __name__ == "__main__":
149
+ main()
kws/sherpa-onnx-kws-gigaspeech-en-1.9.23-arm64-v8a.apk DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:724dcf9b581591c4f66e89c4e38171eab260669f07ce007937872d06ab0526b0
3
- size 26877670
 
 
 
 
kws/sherpa-onnx-kws-gigaspeech-en-1.9.23-armeabi-v7a.apk DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:c37822c1bb4d6ac90110697ccdbe70ebe32462bd50e2bca76abd1df6026e31b8
3
- size 25526012
 
 
 
 
kws/sherpa-onnx-kws-gigaspeech-en-1.9.23-x86.apk DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:6e6b8d9abf62e4f629439ebba97991ccfbd31ee5fc0be379dc2525543f5ade79
3
- size 28098212
 
 
 
 
kws/sherpa-onnx-kws-gigaspeech-en-1.9.23-x86_64.apk DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:0cadd76e29d0223ec2aaad5edf4d67732e7edc2cd60685789c302e88fe78b7b6
3
- size 27803333
 
 
 
 
kws/sherpa-onnx-kws-wenetspeech-zh-1.9.23-arm64-v8a.apk DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:b193096bdc0fdd8da51e05d6125a266fd688ff59a02d3d847883239e4c8ce277
3
- size 26054265
 
 
 
 
kws/sherpa-onnx-kws-wenetspeech-zh-1.9.23-armeabi-v7a.apk DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:3acf03d502b23dd4b7982f1fcc26695c332b1a9de5de24b30dd8f62e5e7cbd1b
3
- size 24706703
 
 
 
 
kws/sherpa-onnx-kws-wenetspeech-zh-1.9.23-x86.apk DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:6ef5a6c868ed9bfbbf829b98890e912d271a56cca9b23697640947952bf322a4
3
- size 27278903
 
 
 
 
kws/sherpa-onnx-kws-wenetspeech-zh-1.9.23-x86_64.apk DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:0f2faa7df7dac2486833e605abc561657030cd1633f197b8eacf5429bf17aad3
3
- size 26979928