Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
11ba35d0
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
大约 2 年 前同步成功
通知
210
Star
8425
Fork
1598
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
245
列表
看板
标记
里程碑
合并请求
3
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DeepSpeech
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
245
Issue
245
列表
看板
标记
里程碑
合并请求
3
合并请求
3
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
11ba35d0
编写于
1月 10, 2022
作者:
H
huangyuxin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix, test=doc_fix
上级
d902f387
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
9 deletion
+13
-9
CHANGELOG.md
CHANGELOG.md
+1
-1
paddlespeech/cli/asr/infer.py
paddlespeech/cli/asr/infer.py
+5
-5
utils/generate_infer_yaml.py
utils/generate_infer_yaml.py
+7
-3
未找到文件。
CHANGELOG.md
浏览文件 @
11ba35d0
...
@@ -6,6 +6,6 @@ Add features to: CLI:
...
@@ -6,6 +6,6 @@ Add features to: CLI:
-
Support English (librispeech/asr1/transformer).
-
Support English (librispeech/asr1/transformer).
-
Support choosing
`decode_method`
for conformer and transformer models.
-
Support choosing
`decode_method`
for conformer and transformer models.
-
Refactor the config, using the unified config.
-
Refactor the config, using the unified config.
-
P
r_l
ink: https://github.com/PaddlePaddle/PaddleSpeech/pull/1297
-
P
RL
ink: https://github.com/PaddlePaddle/PaddleSpeech/pull/1297
***
***
paddlespeech/cli/asr/infer.py
浏览文件 @
11ba35d0
...
@@ -48,9 +48,9 @@ pretrained_models = {
...
@@ -48,9 +48,9 @@ pretrained_models = {
'url'
:
'url'
:
'https://paddlespeech.bj.bcebos.com/s2t/wenetspeech/asr1_conformer_wenetspeech_ckpt_0.1.1.model.tar.gz'
,
'https://paddlespeech.bj.bcebos.com/s2t/wenetspeech/asr1_conformer_wenetspeech_ckpt_0.1.1.model.tar.gz'
,
'md5'
:
'md5'
:
'
b9afd8285ff5b2596bf96afab656b02f
'
,
'
76cb19ed857e6623856b7cd7ebbfeda4
'
,
'cfg_path'
:
'cfg_path'
:
'
conf/conformer_infer
.yaml'
,
'
model
.yaml'
,
'ckpt_path'
:
'ckpt_path'
:
'exp/conformer/checkpoints/wenetspeech'
,
'exp/conformer/checkpoints/wenetspeech'
,
},
},
...
@@ -58,9 +58,9 @@ pretrained_models = {
...
@@ -58,9 +58,9 @@ pretrained_models = {
'url'
:
'url'
:
'https://paddlespeech.bj.bcebos.com/s2t/librispeech/asr1/asr1_transformer_librispeech_ckpt_0.1.1.model.tar.gz'
,
'https://paddlespeech.bj.bcebos.com/s2t/librispeech/asr1/asr1_transformer_librispeech_ckpt_0.1.1.model.tar.gz'
,
'md5'
:
'md5'
:
'
c95b9997f5f81478b32879a38532913d
'
,
'
2c667da24922aad391eacafe37bc1660
'
,
'cfg_path'
:
'cfg_path'
:
'
conf/transformer_infer
.yaml'
,
'
model
.yaml'
,
'ckpt_path'
:
'ckpt_path'
:
'exp/transformer/checkpoints/avg_10'
,
'exp/transformer/checkpoints/avg_10'
,
},
},
...
@@ -176,7 +176,7 @@ class ASRExecutor(BaseExecutor):
...
@@ -176,7 +176,7 @@ class ASRExecutor(BaseExecutor):
else
:
else
:
self
.
cfg_path
=
os
.
path
.
abspath
(
cfg_path
)
self
.
cfg_path
=
os
.
path
.
abspath
(
cfg_path
)
self
.
ckpt_path
=
os
.
path
.
abspath
(
ckpt_path
+
".pdparams"
)
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
)))
os
.
path
.
dirname
(
os
.
path
.
abspath
(
self
.
cfg_path
)))
#Init body.
#Init body.
...
...
utils/generate_infer_yaml.py
浏览文件 @
11ba35d0
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
'''
'''
Merge training configs into a single inference config.
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
import
yaml
...
@@ -88,7 +90,7 @@ def merge_configs(
...
@@ -88,7 +90,7 @@ def merge_configs(
# Remove some parts of the config
# Remove some parts of the config
if
os
.
path
.
exists
(
preprocess_path
):
if
os
.
path
.
exists
(
preprocess_path
):
remove_list
=
[
"train_manifest"
,
remove_
train_
list
=
[
"train_manifest"
,
"dev_manifest"
,
"dev_manifest"
,
"test_manifest"
,
"test_manifest"
,
"n_epoch"
,
"n_epoch"
,
...
@@ -104,6 +106,7 @@ def merge_configs(
...
@@ -104,6 +106,7 @@ def merge_configs(
"weight_decay"
,
"weight_decay"
,
"ctc_grad_norm_type"
,
"ctc_grad_norm_type"
,
"minibatches"
,
"minibatches"
,
"subsampling_factor"
,
"batch_bins"
,
"batch_bins"
,
"batch_count"
,
"batch_count"
,
"batch_frames_in"
,
"batch_frames_in"
,
...
@@ -118,7 +121,7 @@ def merge_configs(
...
@@ -118,7 +121,7 @@ def merge_configs(
"maxlen_out"
,
"maxlen_out"
,
]
]
else
:
else
:
remove_list
=
[
"train_manifest"
,
remove_
train_
list
=
[
"train_manifest"
,
"dev_manifest"
,
"dev_manifest"
,
"test_manifest"
,
"test_manifest"
,
"n_epoch"
,
"n_epoch"
,
...
@@ -135,7 +138,7 @@ def merge_configs(
...
@@ -135,7 +138,7 @@ def merge_configs(
"num_workers"
,
"num_workers"
,
]
]
for
item
in
remove_list
:
for
item
in
remove_
train_
list
:
try
:
try
:
remove_config_part
(
config
,
[
item
])
remove_config_part
(
config
,
[
item
])
except
:
except
:
...
@@ -165,6 +168,7 @@ if __name__ == "__main__":
...
@@ -165,6 +168,7 @@ if __name__ == "__main__":
merge_configs
(
merge_configs
(
conf_path
=
parser_args
.
cfg_pth
,
conf_path
=
parser_args
.
cfg_pth
,
decode_path
=
parser_args
.
dcd_pth
,
preprocess_path
=
parser_args
.
pre_pth
,
preprocess_path
=
parser_args
.
pre_pth
,
vocab_path
=
parser_args
.
vb_pth
,
vocab_path
=
parser_args
.
vb_pth
,
cmvn_path
=
parser_args
.
cmvn_pth
,
cmvn_path
=
parser_args
.
cmvn_pth
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录