fix, test=doc_fix

pull/1297/head
huangyuxin 3 years ago
parent d902f38791
commit 11ba35d08b

@ -6,6 +6,6 @@ Add features to: CLI:
- Support English (librispeech/asr1/transformer).
- Support choosing `decode_method` for conformer and transformer models.
- Refactor the config, using the unified config.
- Pr_link: https://github.com/PaddlePaddle/PaddleSpeech/pull/1297
- PRLink: https://github.com/PaddlePaddle/PaddleSpeech/pull/1297
***

@ -48,9 +48,9 @@ pretrained_models = {
'url':
'https://paddlespeech.bj.bcebos.com/s2t/wenetspeech/asr1_conformer_wenetspeech_ckpt_0.1.1.model.tar.gz',
'md5':
'b9afd8285ff5b2596bf96afab656b02f',
'76cb19ed857e6623856b7cd7ebbfeda4',
'cfg_path':
'conf/conformer_infer.yaml',
'model.yaml',
'ckpt_path':
'exp/conformer/checkpoints/wenetspeech',
},
@ -58,9 +58,9 @@ pretrained_models = {
'url':
'https://paddlespeech.bj.bcebos.com/s2t/librispeech/asr1/asr1_transformer_librispeech_ckpt_0.1.1.model.tar.gz',
'md5':
'c95b9997f5f81478b32879a38532913d',
'2c667da24922aad391eacafe37bc1660',
'cfg_path':
'conf/transformer_infer.yaml',
'model.yaml',
'ckpt_path':
'exp/transformer/checkpoints/avg_10',
},
@ -176,7 +176,7 @@ class ASRExecutor(BaseExecutor):
else:
self.cfg_path = os.path.abspath(cfg_path)
self.ckpt_path = os.path.abspath(ckpt_path + ".pdparams")
res_path = os.path.dirname(
self.res_path = os.path.dirname(
os.path.dirname(os.path.abspath(self.cfg_path)))
#Init body.

@ -3,6 +3,8 @@
'''
Merge training configs into a single inference config.
The single inference config is for CLI, which only takes a single config to do inferencing.
The trainig configs includes: model config, preprocess config, decode config, vocab file and cmvn file.
'''
import yaml
@ -88,7 +90,7 @@ def merge_configs(
# Remove some parts of the config
if os.path.exists(preprocess_path):
remove_list = ["train_manifest",
remove_train_list = ["train_manifest",
"dev_manifest",
"test_manifest",
"n_epoch",
@ -104,6 +106,7 @@ def merge_configs(
"weight_decay",
"ctc_grad_norm_type",
"minibatches",
"subsampling_factor",
"batch_bins",
"batch_count",
"batch_frames_in",
@ -118,7 +121,7 @@ def merge_configs(
"maxlen_out",
]
else:
remove_list = ["train_manifest",
remove_train_list = ["train_manifest",
"dev_manifest",
"test_manifest",
"n_epoch",
@ -135,7 +138,7 @@ def merge_configs(
"num_workers",
]
for item in remove_list:
for item in remove_train_list:
try:
remove_config_part(config, [item])
except:
@ -165,6 +168,7 @@ if __name__ == "__main__":
merge_configs(
conf_path = parser_args.cfg_pth,
decode_path = parser_args.dcd_pth,
preprocess_path = parser_args.pre_pth,
vocab_path = parser_args.vb_pth,
cmvn_path = parser_args.cmvn_pth,

Loading…
Cancel
Save