csukuangfj commited on
Commit
360fd16
1 Parent(s): 3554cd8

small fixes

Browse files
Files changed (2) hide show
  1. app.py +0 -3
  2. model.py +13 -4
app.py CHANGED
@@ -125,9 +125,6 @@ def process(
125
 
126
  filename = convert_to_wav(in_filename)
127
 
128
- logging.info(f"filename: {in_filename}")
129
- os.system(f"ffprobe {filename}")
130
-
131
  now = datetime.now()
132
  date_time = now.strftime("%Y-%m-%d %H:%M:%S.%f")
133
  logging.info(f"Started at {date_time}")
 
125
 
126
  filename = convert_to_wav(in_filename)
127
 
 
 
 
128
  now = datetime.now()
129
  date_time = now.strftime("%Y-%m-%d %H:%M:%S.%f")
130
  logging.info(f"Started at {date_time}")
model.py CHANGED
@@ -262,20 +262,28 @@ def _get_wenetspeech_pre_trained_model(
262
 
263
 
264
  @lru_cache(maxsize=10)
265
- def _get_tal_csasr_pre_trained_model(
266
  repo_id: str,
267
  decoding_method: str,
268
  num_active_paths: int,
269
  ):
270
  assert repo_id in [
271
  "luomingshuang/icefall_asr_tal-csasr_pruned_transducer_stateless5",
 
272
  ], repo_id
273
 
 
 
 
 
 
 
 
274
  nn_model = _get_nn_model_filename(
275
  repo_id=repo_id,
276
- filename="cpu_jit.pt",
277
  )
278
- tokens = _get_token_filename(repo_id=repo_id)
279
 
280
  feat_config = sherpa.FeatureConfig()
281
  feat_config.fbank_opts.frame_opts.samp_freq = sample_rate
@@ -541,7 +549,8 @@ english_models = {
541
  }
542
 
543
  chinese_english_mixed_models = {
544
- "luomingshuang/icefall_asr_tal-csasr_pruned_transducer_stateless5": _get_tal_csasr_pre_trained_model, # noqa
 
545
  }
546
 
547
  tibetan_models = {
 
262
 
263
 
264
  @lru_cache(maxsize=10)
265
+ def _get_chinese_english_mixed_model(
266
  repo_id: str,
267
  decoding_method: str,
268
  num_active_paths: int,
269
  ):
270
  assert repo_id in [
271
  "luomingshuang/icefall_asr_tal-csasr_pruned_transducer_stateless5",
272
+ "ptrnull/icefall-asr-conv-emformer-transducer-stateless2-zh",
273
  ], repo_id
274
 
275
+ if repo_id == "luomingshuang/icefall_asr_tal-csasr_pruned_transducer_stateless5":
276
+ filename = "cpu_jit.pt"
277
+ subfolder = "data/lang_char"
278
+ elif repo_id == "ptrnull/icefall-asr-conv-emformer-transducer-stateless2-zh":
279
+ filename = "cpu_jit-epoch-11-avg-1.pt"
280
+ subfolder = "data/lang_char_bpe"
281
+
282
  nn_model = _get_nn_model_filename(
283
  repo_id=repo_id,
284
+ filename=filename,
285
  )
286
+ tokens = _get_token_filename(repo_id=repo_id, subfolder=subfolder)
287
 
288
  feat_config = sherpa.FeatureConfig()
289
  feat_config.fbank_opts.frame_opts.samp_freq = sample_rate
 
549
  }
550
 
551
  chinese_english_mixed_models = {
552
+ "ptrnull/icefall-asr-conv-emformer-transducer-stateless2-zh": _get_chinese_english_mixed_model,
553
+ "luomingshuang/icefall_asr_tal-csasr_pruned_transducer_stateless5": _get_chinese_english_mixed_model, # noqa
554
  }
555
 
556
  tibetan_models = {