Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
a2208013
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看板
提交
a2208013
编写于
1月 21, 2022
作者:
J
Jerryuhoo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add speedyspeech multi-speaker support for synthesize_e2e.py, test=tts
上级
49fd55dc
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
32 addition
and
18 deletion
+32
-18
paddlespeech/t2s/exps/synthesize_e2e.py
paddlespeech/t2s/exps/synthesize_e2e.py
+32
-18
未找到文件。
paddlespeech/t2s/exps/synthesize_e2e.py
浏览文件 @
a2208013
...
@@ -129,7 +129,10 @@ def evaluate(args):
...
@@ -129,7 +129,10 @@ def evaluate(args):
idim
=
vocab_size
,
odim
=
odim
,
spk_num
=
spk_num
,
**
am_config
[
"model"
])
idim
=
vocab_size
,
odim
=
odim
,
spk_num
=
spk_num
,
**
am_config
[
"model"
])
elif
am_name
==
'speedyspeech'
:
elif
am_name
==
'speedyspeech'
:
am
=
am_class
(
am
=
am_class
(
vocab_size
=
vocab_size
,
tone_size
=
tone_size
,
**
am_config
[
"model"
])
vocab_size
=
vocab_size
,
tone_size
=
tone_size
,
spk_num
=
spk_num
,
**
am_config
[
"model"
])
elif
am_name
==
'tacotron2'
:
elif
am_name
==
'tacotron2'
:
am
=
am_class
(
idim
=
vocab_size
,
odim
=
odim
,
**
am_config
[
"model"
])
am
=
am_class
(
idim
=
vocab_size
,
odim
=
odim
,
**
am_config
[
"model"
])
...
@@ -171,25 +174,31 @@ def evaluate(args):
...
@@ -171,25 +174,31 @@ def evaluate(args):
InputSpec
([
-
1
],
dtype
=
paddle
.
int64
),
InputSpec
([
-
1
],
dtype
=
paddle
.
int64
),
InputSpec
([
1
],
dtype
=
paddle
.
int64
)
InputSpec
([
1
],
dtype
=
paddle
.
int64
)
])
])
paddle
.
jit
.
save
(
am_inference
,
os
.
path
.
join
(
args
.
inference_dir
,
args
.
am
))
am_inference
=
paddle
.
jit
.
load
(
os
.
path
.
join
(
args
.
inference_dir
,
args
.
am
))
else
:
else
:
am_inference
=
jit
.
to_static
(
am_inference
=
jit
.
to_static
(
am_inference
,
am_inference
,
input_spec
=
[
InputSpec
([
-
1
],
dtype
=
paddle
.
int64
)])
input_spec
=
[
InputSpec
([
-
1
],
dtype
=
paddle
.
int64
)])
paddle
.
jit
.
save
(
am_inference
,
paddle
.
jit
.
save
(
am_inference
,
os
.
path
.
join
(
args
.
inference_dir
,
args
.
am
))
os
.
path
.
join
(
args
.
inference_dir
,
args
.
am
))
am_inference
=
paddle
.
jit
.
load
(
am_inference
=
paddle
.
jit
.
load
(
os
.
path
.
join
(
args
.
inference_dir
,
args
.
am
))
os
.
path
.
join
(
args
.
inference_dir
,
args
.
am
))
elif
am_name
==
'speedyspeech'
:
elif
am_name
==
'speedyspeech'
:
am_inference
=
jit
.
to_static
(
if
am_dataset
in
{
"aishell3"
,
"vctk"
}
and
args
.
speaker_dict
:
am_inference
,
am_inference
=
jit
.
to_static
(
input_spec
=
[
am_inference
,
InputSpec
([
-
1
],
dtype
=
paddle
.
int64
),
input_spec
=
[
InputSpec
([
-
1
],
dtype
=
paddle
.
int64
)
InputSpec
([
-
1
],
dtype
=
paddle
.
int64
),
# text
])
InputSpec
([
-
1
],
dtype
=
paddle
.
int64
),
# tone
None
,
# duration
InputSpec
([
-
1
],
dtype
=
paddle
.
int64
)
# spk_id
])
else
:
am_inference
=
jit
.
to_static
(
am_inference
,
input_spec
=
[
InputSpec
([
-
1
],
dtype
=
paddle
.
int64
),
InputSpec
([
-
1
],
dtype
=
paddle
.
int64
)
])
paddle
.
jit
.
save
(
am_inference
,
paddle
.
jit
.
save
(
am_inference
,
os
.
path
.
join
(
args
.
inference_dir
,
args
.
am
))
os
.
path
.
join
(
args
.
inference_dir
,
args
.
am
))
...
@@ -242,7 +251,12 @@ def evaluate(args):
...
@@ -242,7 +251,12 @@ def evaluate(args):
mel
=
am_inference
(
part_phone_ids
)
mel
=
am_inference
(
part_phone_ids
)
elif
am_name
==
'speedyspeech'
:
elif
am_name
==
'speedyspeech'
:
part_tone_ids
=
tone_ids
[
i
]
part_tone_ids
=
tone_ids
[
i
]
mel
=
am_inference
(
part_phone_ids
,
part_tone_ids
)
if
am_dataset
in
{
"aishell3"
,
"vctk"
}:
spk_id
=
paddle
.
to_tensor
(
args
.
spk_id
)
mel
=
am_inference
(
part_phone_ids
,
part_tone_ids
,
spk_id
)
else
:
mel
=
am_inference
(
part_phone_ids
,
part_tone_ids
)
elif
am_name
==
'tacotron2'
:
elif
am_name
==
'tacotron2'
:
mel
=
am_inference
(
part_phone_ids
)
mel
=
am_inference
(
part_phone_ids
)
# vocoder
# vocoder
...
@@ -269,8 +283,8 @@ def main():
...
@@ -269,8 +283,8 @@ def main():
type
=
str
,
type
=
str
,
default
=
'fastspeech2_csmsc'
,
default
=
'fastspeech2_csmsc'
,
choices
=
[
choices
=
[
'speedyspeech_csmsc'
,
'
fastspeech2_csmsc'
,
'fastspeech2_ljspeech
'
,
'speedyspeech_csmsc'
,
'
speedyspeech_aishell3'
,
'fastspeech2_csmsc
'
,
'fastspeech2_
aishell3'
,
'fastspeech2_vctk'
,
'tacotron2_csmsc
'
'fastspeech2_
ljspeech'
,
'fastspeech2_aishell3'
,
'fastspeech2_vctk
'
],
],
help
=
'Choose acoustic model type of tts task.'
)
help
=
'Choose acoustic model type of tts task.'
)
parser
.
add_argument
(
parser
.
add_argument
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录