csukuangfj
commited on
Commit
•
b81c7d0
1
Parent(s):
9f979bc
fix slid
Browse files- generate-audio-tagging.py +1 -1
- generate-slid.py +104 -0
- slid/sherpa-onnx-1.9.22-arm64-v8a-audio-tagging-whisper_tiny.apk +0 -3
- slid/sherpa-onnx-1.9.22-armeabi-v7a-audio-tagging-whisper_tiny.apk +0 -3
- slid/sherpa-onnx-1.9.22-x86-audio-tagging-whisper_tiny.apk +0 -3
- slid/sherpa-onnx-1.9.22-x86_64-audio-tagging-whisper_tiny.apk +0 -3
generate-audio-tagging.py
CHANGED
@@ -33,7 +33,7 @@ class APK:
|
|
33 |
if "arm64" in self.arch:
|
34 |
self.arch = "z" + self.arch
|
35 |
|
36 |
-
if "small" in self.short_name:
|
37 |
self.short_name = "zzz" + self.short_name
|
38 |
|
39 |
|
|
|
33 |
if "arm64" in self.arch:
|
34 |
self.arch = "z" + self.arch
|
35 |
|
36 |
+
if "small" in self.short_name and "zip" in self.short_name:
|
37 |
self.short_name = "zzz" + self.short_name
|
38 |
|
39 |
|
generate-slid.py
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.22-x86-slid-whisper_tiny.apk
|
22 |
+
# sherpa-onnx-1.9.22-arm64-v8a-slid-whisper_tiny.apk
|
23 |
+
s = str(s)[len("slid/") :]
|
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[5]
|
28 |
+
if "arm" in s:
|
29 |
+
self.arch += "-" + split[4]
|
30 |
+
self.short_name = split[6]
|
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 spoken language identification </h1>
|
60 |
+
This page lists the <strong>spoken language identification</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}-slid-{model}.apk
|
66 |
+
</ul>
|
67 |
+
where
|
68 |
+
<ul>
|
69 |
+
<li> version: It specifies the current version, e.g., 1.9.21
|
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/><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 |
+
Please see
|
83 |
+
<a href="https://k2-fsa.github.io/sherpa/onnx/spolken-language-identification/">https://k2-fsa.github.io/sherpa/onnx/spolken-language-identification/</a>
|
84 |
+
for more information.
|
85 |
+
|
86 |
+
<br/>
|
87 |
+
<br/>
|
88 |
+
|
89 |
+
<div/>
|
90 |
+
"""
|
91 |
+
with open(filename, "w") as f:
|
92 |
+
print(content, file=f)
|
93 |
+
for x in files:
|
94 |
+
name = x.rsplit("/", maxsplit=1)[-1]
|
95 |
+
print(f'<a href="{x}" />{name}<br/>', file=f)
|
96 |
+
|
97 |
+
|
98 |
+
def main():
|
99 |
+
apk = get_all_files("slid", suffix="*.apk")
|
100 |
+
to_file("./apk-slid.html", apk)
|
101 |
+
|
102 |
+
|
103 |
+
if __name__ == "__main__":
|
104 |
+
main()
|
slid/sherpa-onnx-1.9.22-arm64-v8a-audio-tagging-whisper_tiny.apk
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:e2b93d8e4d4a1c5563ac4430410fb43b38604a24f7ee6f44b8fab84cc2033e71
|
3 |
-
size 73752308
|
|
|
|
|
|
|
|
slid/sherpa-onnx-1.9.22-armeabi-v7a-audio-tagging-whisper_tiny.apk
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:b78aad3d4644ddec44cda925fa04cefe6879c916755e5647928943cb1862a56d
|
3 |
-
size 72728330
|
|
|
|
|
|
|
|
slid/sherpa-onnx-1.9.22-x86-audio-tagging-whisper_tiny.apk
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:67ccdf713095674c8827db4b7e595e456d4eec42a62e8a17748a53faeb574ed9
|
3 |
-
size 74661554
|
|
|
|
|
|
|
|
slid/sherpa-onnx-1.9.22-x86_64-audio-tagging-whisper_tiny.apk
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:e769daf59b9d6f2b855b9efbf5fef500f049c838a163d7195a123408e9e8de37
|
3 |
-
size 74419923
|
|
|
|
|
|
|
|