Spaces:
Sleeping
Sleeping
update
Browse files
examples/wenet/toolbox_infer.py
CHANGED
|
@@ -57,13 +57,6 @@ def main():
|
|
| 57 |
nn_model_file = local_model_dir / m_dict["nn_model_file"]
|
| 58 |
tokens_file = local_model_dir / m_dict["tokens_file"]
|
| 59 |
|
| 60 |
-
# recognizer = models.load_sherpa_offline_recognizer(
|
| 61 |
-
# nn_model_file=nn_model_file.as_posix(),
|
| 62 |
-
# tokens_file=tokens_file.as_posix(),
|
| 63 |
-
# decoding_method="greedy_search",
|
| 64 |
-
# num_active_paths=2,
|
| 65 |
-
# )
|
| 66 |
-
|
| 67 |
recognizer = models.load_recognizer(
|
| 68 |
repo_id=m_dict["repo_id"],
|
| 69 |
nn_model_file=nn_model_file.as_posix(),
|
|
@@ -75,21 +68,6 @@ def main():
|
|
| 75 |
num_active_paths=2,
|
| 76 |
)
|
| 77 |
|
| 78 |
-
# feat_config = sherpa.FeatureConfig(normalize_samples=False)
|
| 79 |
-
# feat_config.fbank_opts.frame_opts.samp_freq = args.sample_rate
|
| 80 |
-
# feat_config.fbank_opts.mel_opts.num_bins = 80
|
| 81 |
-
# feat_config.fbank_opts.frame_opts.dither = 0
|
| 82 |
-
#
|
| 83 |
-
# config = sherpa.OfflineRecognizerConfig(
|
| 84 |
-
# nn_model=nn_model_file.as_posix(),
|
| 85 |
-
# tokens=tokens_file.as_posix(),
|
| 86 |
-
# use_gpu=False,
|
| 87 |
-
# feat_config=feat_config,
|
| 88 |
-
# decoding_method="greedy_search",
|
| 89 |
-
# num_active_paths=2,
|
| 90 |
-
# )
|
| 91 |
-
# recognizer = sherpa.OfflineRecognizer(config)
|
| 92 |
-
|
| 93 |
text = decode.decode_by_recognizer(recognizer=recognizer,
|
| 94 |
filename=out_filename.as_posix(),
|
| 95 |
)
|
|
|
|
| 57 |
nn_model_file = local_model_dir / m_dict["nn_model_file"]
|
| 58 |
tokens_file = local_model_dir / m_dict["tokens_file"]
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
recognizer = models.load_recognizer(
|
| 61 |
repo_id=m_dict["repo_id"],
|
| 62 |
nn_model_file=nn_model_file.as_posix(),
|
|
|
|
| 68 |
num_active_paths=2,
|
| 69 |
)
|
| 70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
text = decode.decode_by_recognizer(recognizer=recognizer,
|
| 72 |
filename=out_filename.as_posix(),
|
| 73 |
)
|