Support non-streaming WeNet CTC models. (#426)

This commit is contained in:
Fangjun Kuang
2023-11-15 14:23:20 +08:00
committed by GitHub
parent d34640e3a3
commit b83b3e3cd1
21 changed files with 469 additions and 32 deletions

View File

@@ -172,7 +172,7 @@ def main():
# https://wenet.org.cn/downloads?models=wenet&version=aishell_u2pp_conformer_exp.tar.gz
url = os.environ.get("WENET_URL", "")
meta_data = {
"model_type": "wenet-ctc",
"model_type": "wenet_ctc",
"version": "1",
"model_author": "wenet",
"comment": "streaming",
@@ -185,6 +185,7 @@ def main():
"cnn_module_kernel": cnn_module_kernel,
"right_context": right_context,
"subsampling_factor": subsampling_factor,
"vocab_size": torch_model.ctc.ctc_lo.weight.shape[0],
}
add_meta_data(filename=filename, meta_data=meta_data)

View File

@@ -107,10 +107,12 @@ def main():
# https://wenet.org.cn/downloads?models=wenet&version=aishell_u2pp_conformer_exp.tar.gz
url = os.environ.get("WENET_URL", "")
meta_data = {
"model_type": "wenet-ctc",
"model_type": "wenet_ctc",
"version": "1",
"model_author": "wenet",
"comment": "non-streaming",
"subsampling_factor": torch_model.encoder.embed.subsampling_rate,
"vocab_size": torch_model.ctc.ctc_lo.weight.shape[0],
"url": url,
}
add_meta_data(filename=filename, meta_data=meta_data)