csukuangfj commited on
Commit
f3332c3
1 Parent(s): 2903eae

minor fixes

Browse files
app.py CHANGED
@@ -27,6 +27,7 @@ from datetime import datetime
27
  import gradio as gr
28
  import torchaudio
29
 
 
30
  from model import get_pretrained_model, language_to_models, sample_rate
31
 
32
  languages = list(language_to_models.keys())
@@ -210,30 +211,6 @@ def update_model_dropdown(language: str):
210
 
211
  demo = gr.Blocks(css=css)
212
 
213
- examples = [
214
- [
215
- "Chinese",
216
- "luomingshuang/icefall_asr_wenetspeech_pruned_transducer_stateless2",
217
- "greedy_search",
218
- 4,
219
- "./test_wavs/wenetspeech/DEV_T0000000000.opus",
220
- ],
221
- [
222
- "Chinese",
223
- "luomingshuang/icefall_asr_wenetspeech_pruned_transducer_stateless2",
224
- "greedy_search",
225
- 4,
226
- "./test_wavs/wenetspeech/DEV_T0000000001.opus",
227
- ],
228
- [
229
- "Chinese",
230
- "luomingshuang/icefall_asr_wenetspeech_pruned_transducer_stateless2",
231
- "greedy_search",
232
- 4,
233
- "./test_wavs/wenetspeech/DEV_T0000000002.opus",
234
- ],
235
- ]
236
-
237
 
238
  with demo:
239
  gr.Markdown(title)
 
27
  import gradio as gr
28
  import torchaudio
29
 
30
+ from examples import examples
31
  from model import get_pretrained_model, language_to_models, sample_rate
32
 
33
  languages = list(language_to_models.keys())
 
211
 
212
  demo = gr.Blocks(css=css)
213
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
 
215
  with demo:
216
  gr.Markdown(title)
examples.py ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ #
3
+ # Copyright 2022 Xiaomi Corp. (authors: Fangjun Kuang)
4
+ #
5
+ # See LICENSE for clarification regarding multiple authors
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ examples = [
19
+ # wenetspeech
20
+ # https://huggingface.co/luomingshuang/icefall_asr_wenetspeech_pruned_transducer_stateless2/tree/main/test_wavs
21
+ [
22
+ "Chinese",
23
+ "luomingshuang/icefall_asr_wenetspeech_pruned_transducer_stateless2",
24
+ "greedy_search",
25
+ 4,
26
+ "./test_wavs/wenetspeech/DEV_T0000000000.opus",
27
+ ],
28
+ [
29
+ "Chinese",
30
+ "luomingshuang/icefall_asr_wenetspeech_pruned_transducer_stateless2",
31
+ "greedy_search",
32
+ 4,
33
+ "./test_wavs/wenetspeech/DEV_T0000000001.opus",
34
+ ],
35
+ [
36
+ "Chinese",
37
+ "luomingshuang/icefall_asr_wenetspeech_pruned_transducer_stateless2",
38
+ "greedy_search",
39
+ 4,
40
+ "./test_wavs/wenetspeech/DEV_T0000000002.opus",
41
+ ],
42
+ # aishell2-A
43
+ # https://huggingface.co/yuekai/icefall-asr-aishell2-pruned-transducer-stateless5-A-2022-07-12/tree/main/test_wavs
44
+ [
45
+ "Chinese",
46
+ "yuekai/icefall-asr-aishell2-pruned-transducer-stateless5-A-2022-07-12",
47
+ "greedy_search",
48
+ 4,
49
+ "./test_wavs/aishell2/ID0012W0030.wav",
50
+ ],
51
+ [
52
+ "Chinese",
53
+ "yuekai/icefall-asr-aishell2-pruned-transducer-stateless5-A-2022-07-12",
54
+ "greedy_search",
55
+ 4,
56
+ "./test_wavs/aishell2/ID0012W0162.wav",
57
+ ],
58
+ [
59
+ "Chinese",
60
+ "yuekai/icefall-asr-aishell2-pruned-transducer-stateless5-A-2022-07-12",
61
+ "greedy_search",
62
+ 4,
63
+ "./test_wavs/aishell2/ID0012W0215.wav",
64
+ ],
65
+ # aishell2-B
66
+ # https://huggingface.co/yuekai/icefall-asr-aishell2-pruned-transducer-stateless5-A-2022-07-12/tree/main/test_wavs
67
+ [
68
+ "Chinese",
69
+ "yuekai/icefall-asr-aishell2-pruned-transducer-stateless5-B-2022-07-12",
70
+ "greedy_search",
71
+ 4,
72
+ "./test_wavs/aishell2/ID0012W0030.wav",
73
+ ],
74
+ [
75
+ "Chinese",
76
+ "yuekai/icefall-asr-aishell2-pruned-transducer-stateless5-B-2022-07-12",
77
+ "greedy_search",
78
+ 4,
79
+ "./test_wavs/aishell2/ID0012W0162.wav",
80
+ ],
81
+ [
82
+ "Chinese",
83
+ "yuekai/icefall-asr-aishell2-pruned-transducer-stateless5-B-2022-07-12",
84
+ "greedy_search",
85
+ 4,
86
+ "./test_wavs/aishell2/ID0012W0215.wav",
87
+ ],
88
+ ]
test_wavs/aishell2/ID0012W0030.wav ADDED
Binary file (113 kB). View file
 
test_wavs/aishell2/ID0012W0162.wav ADDED
Binary file (114 kB). View file
 
test_wavs/aishell2/ID0012W0215.wav ADDED
Binary file (104 kB). View file
 
test_wavs/aishell2/README.md ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ Files are downloaded from
2
+ https://huggingface.co/yuekai/icefall-asr-aishell2-pruned-transducer-stateless5-B-2022-07-12/tree/main/test_wavs
test_wavs/aishell2/trans.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ ID0012W0162 立法机关采纳了第二种意见
2
+ ID0012W0215 大家都愿意牺牲自己的生命
3
+ ID0012W0030 完全是典型的军事侵略