Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
2a42421a
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
12 个月 前同步成功
通知
205
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2a42421a
编写于
1月 27, 2022
作者:
H
huangyuxin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cli add ds2-librispeech offline, fix versionm, test=asr
上级
4128f4d6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
26 addition
and
15 deletion
+26
-15
paddlespeech/cli/asr/infer.py
paddlespeech/cli/asr/infer.py
+23
-12
paddlespeech/cli/utils.py
paddlespeech/cli/utils.py
+1
-1
paddlespeech/s2t/io/sampler.py
paddlespeech/s2t/io/sampler.py
+1
-1
paddlespeech/t2s/modules/transformer/repeat.py
paddlespeech/t2s/modules/transformer/repeat.py
+1
-1
未找到文件。
paddlespeech/cli/asr/infer.py
浏览文件 @
2a42421a
...
@@ -91,6 +91,20 @@ pretrained_models = {
...
@@ -91,6 +91,20 @@ pretrained_models = {
'lm_md5'
:
'lm_md5'
:
'29e02312deb2e59b3c8686c7966d4fe3'
'29e02312deb2e59b3c8686c7966d4fe3'
},
},
"deepspeech2offline_librispeech-en-16k"
:
{
'url'
:
'https://paddlespeech.bj.bcebos.com/s2t/librispeech/asr0/asr0_deepspeech2_librispeech_ckpt_0.1.1.model.tar.gz'
,
'md5'
:
'f5666c81ad015c8de03aac2bc92e5762'
,
'cfg_path'
:
'model.yaml'
,
'ckpt_path'
:
'exp/deepspeech2/checkpoints/avg_1'
,
'lm_url'
:
'https://deepspeech.bj.bcebos.com/en_lm/common_crawl_00.prune01111.trie.klm'
,
'lm_md5'
:
'099a601759d467cd0a8523ff939819c5'
},
}
}
model_alias
=
{
model_alias
=
{
...
@@ -328,18 +342,15 @@ class ASRExecutor(BaseExecutor):
...
@@ -328,18 +342,15 @@ class ASRExecutor(BaseExecutor):
audio
=
self
.
_inputs
[
"audio"
]
audio
=
self
.
_inputs
[
"audio"
]
audio_len
=
self
.
_inputs
[
"audio_len"
]
audio_len
=
self
.
_inputs
[
"audio_len"
]
if
"deepspeech2online"
in
model_type
or
"deepspeech2offline"
in
model_type
:
if
"deepspeech2online"
in
model_type
or
"deepspeech2offline"
in
model_type
:
result_transcripts
=
self
.
model
.
decode
(
decode_batch_size
=
audio
.
shape
[
0
]
audio
,
self
.
model
.
decoder
.
init_decoder
(
audio_len
,
decode_batch_size
,
self
.
text_feature
.
vocab_list
,
self
.
text_feature
.
vocab_list
,
cfg
.
decoding_method
,
cfg
.
lang_model_path
,
cfg
.
alpha
,
cfg
.
beta
,
decoding_method
=
cfg
.
decoding_method
,
cfg
.
beam_size
,
cfg
.
cutoff_prob
,
cfg
.
cutoff_top_n
,
lang_model_path
=
cfg
.
lang_model_path
,
cfg
.
num_proc_bsearch
)
beam_alpha
=
cfg
.
alpha
,
beam_beta
=
cfg
.
beta
,
result_transcripts
=
self
.
model
.
decode
(
audio
,
audio_len
)
beam_size
=
cfg
.
beam_size
,
self
.
model
.
decoder
.
del_decoder
()
cutoff_prob
=
cfg
.
cutoff_prob
,
cutoff_top_n
=
cfg
.
cutoff_top_n
,
num_processes
=
cfg
.
num_proc_bsearch
)
self
.
_outputs
[
"result"
]
=
result_transcripts
[
0
]
self
.
_outputs
[
"result"
]
=
result_transcripts
[
0
]
elif
"conformer"
in
model_type
or
"transformer"
in
model_type
:
elif
"conformer"
in
model_type
or
"transformer"
in
model_type
:
...
...
paddlespeech/cli/utils.py
浏览文件 @
2a42421a
...
@@ -34,7 +34,7 @@ from .entry import commands
...
@@ -34,7 +34,7 @@ from .entry import commands
try
:
try
:
from
..
import
__version__
from
..
import
__version__
except
ImportError
:
except
ImportError
:
__version__
=
0.0
.
0
# for develop branch
__version__
=
"0.0.0"
# for develop branch
requests
.
adapters
.
DEFAULT_RETRIES
=
3
requests
.
adapters
.
DEFAULT_RETRIES
=
3
...
...
paddlespeech/s2t/io/sampler.py
浏览文件 @
2a42421a
...
@@ -51,7 +51,7 @@ def _batch_shuffle(indices, batch_size, epoch, clipped=False):
...
@@ -51,7 +51,7 @@ def _batch_shuffle(indices, batch_size, epoch, clipped=False):
"""
"""
rng
=
np
.
random
.
RandomState
(
epoch
)
rng
=
np
.
random
.
RandomState
(
epoch
)
shift_len
=
rng
.
randint
(
0
,
batch_size
-
1
)
shift_len
=
rng
.
randint
(
0
,
batch_size
-
1
)
batch_indices
=
list
(
zip
(
*
[
iter
(
indices
[
shift_len
:])]
*
batch_size
))
batch_indices
=
list
(
zip
(
*
[
iter
(
indices
[
shift_len
:])]
*
batch_size
))
rng
.
shuffle
(
batch_indices
)
rng
.
shuffle
(
batch_indices
)
batch_indices
=
[
item
for
batch
in
batch_indices
for
item
in
batch
]
batch_indices
=
[
item
for
batch
in
batch_indices
for
item
in
batch
]
assert
clipped
is
False
assert
clipped
is
False
...
...
paddlespeech/t2s/modules/transformer/repeat.py
浏览文件 @
2a42421a
...
@@ -41,4 +41,4 @@ def repeat(N, fn):
...
@@ -41,4 +41,4 @@ def repeat(N, fn):
MultiSequential
MultiSequential
Repeated model instance.
Repeated model instance.
"""
"""
return
MultiSequential
(
*
[
fn
(
n
)
for
n
in
range
(
N
)])
return
MultiSequential
(
*
[
fn
(
n
)
for
n
in
range
(
N
)])
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录