csukuangfj commited on
Commit
6f26bbb
1 Parent(s): 376cd19

add tibetan

Browse files
examples.py CHANGED
@@ -176,4 +176,25 @@ examples = [
176
  4,
177
  "./test_wavs/tal_csasr/210_36476_210_8341_1_1533271973_7057520_145.wav",
178
  ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  ]
 
176
  4,
177
  "./test_wavs/tal_csasr/210_36476_210_8341_1_1533271973_7057520_145.wav",
178
  ],
179
+ [
180
+ "Tibetan",
181
+ "syzym/icefall-asr-xbmu-amdo31-pruned-transducer-stateless5-2022-11-29",
182
+ "greedy_search",
183
+ 4,
184
+ "./test_wavs/tibetan/a_0_cacm-A70_31116.wav",
185
+ ],
186
+ [
187
+ "Tibetan",
188
+ "syzym/icefall-asr-xbmu-amdo31-pruned-transducer-stateless5-2022-11-29",
189
+ "greedy_search",
190
+ 4,
191
+ "./test_wavs/tibetan/a_0_cacm-A70_31117.wav",
192
+ ],
193
+ [
194
+ "Tibetan",
195
+ "syzym/icefall-asr-xbmu-amdo31-pruned-transducer-stateless5-2022-11-29",
196
+ "greedy_search",
197
+ 4,
198
+ "./test_wavs/tibetan/a_0_cacm-A70_31118.wav",
199
+ ],
200
  ]
model.py CHANGED
@@ -233,6 +233,27 @@ def _get_aidatatang_200zh_pretrained_mode(repo_id: str):
233
  )
234
 
235
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  chinese_models = {
237
  "luomingshuang/icefall_asr_wenetspeech_pruned_transducer_stateless2": _get_wenetspeech_pre_trained_model, # noqa
238
  "yuekai/icefall-asr-aishell2-pruned-transducer-stateless5-A-2022-07-12": _get_aishell2_pretrained_model, # noqa
@@ -252,14 +273,20 @@ chinese_english_mixed_models = {
252
  "luomingshuang/icefall_asr_tal-csasr_pruned_transducer_stateless5": _get_tal_csasr_pre_trained_model, # noqa
253
  }
254
 
 
 
 
 
255
  all_models = {
256
  **chinese_models,
257
  **english_models,
258
  **chinese_english_mixed_models,
 
259
  }
260
 
261
  language_to_models = {
262
  "Chinese": list(chinese_models.keys()),
263
  "English": list(english_models.keys()),
264
  "Chinese+English": list(chinese_english_mixed_models.keys()),
 
265
  }
 
233
  )
234
 
235
 
236
+ @lru_cache(maxsize=10)
237
+ def _get_tibetan_pre_trained_model(repo_id: str):
238
+ assert repo_id in [
239
+ "syzym/icefall-asr-xbmu-amdo31-pruned-transducer-stateless5-2022-11-29",
240
+ ], repo_id
241
+
242
+ nn_model_filename = _get_nn_model_filename(
243
+ repo_id=repo_id,
244
+ filename="cpu_jit.pt",
245
+ )
246
+ bpe_model_filename = _get_bpe_model_filename(repo_id=repo_id)
247
+
248
+ return OfflineAsr(
249
+ nn_model_filename=nn_model_filename,
250
+ bpe_model_filename=bpe_model_filename,
251
+ token_filename=None,
252
+ sample_rate=sample_rate,
253
+ device="cpu",
254
+ )
255
+
256
+
257
  chinese_models = {
258
  "luomingshuang/icefall_asr_wenetspeech_pruned_transducer_stateless2": _get_wenetspeech_pre_trained_model, # noqa
259
  "yuekai/icefall-asr-aishell2-pruned-transducer-stateless5-A-2022-07-12": _get_aishell2_pretrained_model, # noqa
 
273
  "luomingshuang/icefall_asr_tal-csasr_pruned_transducer_stateless5": _get_tal_csasr_pre_trained_model, # noqa
274
  }
275
 
276
+ tibetan_models = {
277
+ "syzym/icefall-asr-xbmu-amdo31-pruned-transducer-stateless5-2022-11-29": _get_tibetan_pre_trained_model, # noqa
278
+ }
279
+
280
  all_models = {
281
  **chinese_models,
282
  **english_models,
283
  **chinese_english_mixed_models,
284
+ **tibetan_models,
285
  }
286
 
287
  language_to_models = {
288
  "Chinese": list(chinese_models.keys()),
289
  "English": list(english_models.keys()),
290
  "Chinese+English": list(chinese_english_mixed_models.keys()),
291
+ "Tibetan": list(tibetan_models.keys()),
292
  }
test_wavs/tibetan/a_0_cacm-A70_31116.wav ADDED
Binary file (97.4 kB). View file
 
test_wavs/tibetan/a_0_cacm-A70_31117.wav ADDED
Binary file (128 kB). View file
 
test_wavs/tibetan/a_0_cacm-A70_31118.wav ADDED
Binary file (87.1 kB). View file
 
test_wavs/tibetan/trans.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ a_0_cacm-A70_31116.wav ལོ བཅུ ཙམ མ འདང བའི དུས སྐབས ནང
2
+ a_0_cacm-A70_31117.wav དྲག པོའི ངོ ལོག ཟིང འཁྲུག སྒྲིག འཛུགས དང ངན བཀོད བྱས ཡོད
3
+ a_0_cacm-A70_31118.wav གནས བབ འདིའི རིགས གང མགྱོགས འགྱུར བ གཏོང དགོས