Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
a283f8a5
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看板
未验证
提交
a283f8a5
编写于
2月 02, 2023
作者:
小湉湉
提交者:
GitHub
2月 02, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TTS]fix open encoding (#2865)
上级
a55fd2e5
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
24 addition
and
24 deletion
+24
-24
paddlespeech/cli/tts/infer.py
paddlespeech/cli/tts/infer.py
+3
-3
paddlespeech/t2s/exps/ernie_sat/synthesize_e2e.py
paddlespeech/t2s/exps/ernie_sat/synthesize_e2e.py
+1
-1
paddlespeech/t2s/exps/ernie_sat/train.py
paddlespeech/t2s/exps/ernie_sat/train.py
+1
-1
paddlespeech/t2s/exps/fastspeech2/train.py
paddlespeech/t2s/exps/fastspeech2/train.py
+2
-2
paddlespeech/t2s/exps/speedyspeech/synthesize_e2e.py
paddlespeech/t2s/exps/speedyspeech/synthesize_e2e.py
+3
-3
paddlespeech/t2s/exps/speedyspeech/train.py
paddlespeech/t2s/exps/speedyspeech/train.py
+3
-3
paddlespeech/t2s/exps/syn_utils.py
paddlespeech/t2s/exps/syn_utils.py
+4
-4
paddlespeech/t2s/exps/tacotron2/train.py
paddlespeech/t2s/exps/tacotron2/train.py
+1
-1
paddlespeech/t2s/exps/transformer_tts/train.py
paddlespeech/t2s/exps/transformer_tts/train.py
+1
-1
paddlespeech/t2s/exps/vits/train.py
paddlespeech/t2s/exps/vits/train.py
+2
-2
paddlespeech/t2s/frontend/phonectic.py
paddlespeech/t2s/frontend/phonectic.py
+1
-1
paddlespeech/t2s/frontend/zh_frontend.py
paddlespeech/t2s/frontend/zh_frontend.py
+2
-2
未找到文件。
paddlespeech/cli/tts/infer.py
浏览文件 @
a283f8a5
...
...
@@ -292,19 +292,19 @@ class TTSExecutor(BaseExecutor):
with
open
(
self
.
voc_config
)
as
f
:
self
.
voc_config
=
CfgNode
(
yaml
.
safe_load
(
f
))
with
open
(
self
.
phones_dict
,
"r"
)
as
f
:
with
open
(
self
.
phones_dict
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
phn_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
vocab_size
=
len
(
phn_id
)
tone_size
=
None
if
self
.
tones_dict
:
with
open
(
self
.
tones_dict
,
"r"
)
as
f
:
with
open
(
self
.
tones_dict
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
tone_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
tone_size
=
len
(
tone_id
)
spk_num
=
None
if
self
.
speaker_dict
:
with
open
(
self
.
speaker_dict
,
'rt'
)
as
f
:
with
open
(
self
.
speaker_dict
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
spk_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
spk_num
=
len
(
spk_id
)
...
...
paddlespeech/t2s/exps/ernie_sat/synthesize_e2e.py
浏览文件 @
a283f8a5
...
...
@@ -437,7 +437,7 @@ if __name__ == '__main__':
vocab_phones
=
{}
with
open
(
args
.
phones_dict
,
'rt'
)
as
f
:
with
open
(
args
.
phones_dict
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
phn_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
for
phn
,
id
in
phn_id
:
vocab_phones
[
phn
]
=
int
(
id
)
...
...
paddlespeech/t2s/exps/ernie_sat/train.py
浏览文件 @
a283f8a5
...
...
@@ -109,7 +109,7 @@ def train_sp(args, config):
num_workers
=
config
.
num_workers
)
print
(
"dataloaders done!"
)
with
open
(
args
.
phones_dict
,
"r"
)
as
f
:
with
open
(
args
.
phones_dict
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
phn_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
vocab_size
=
len
(
phn_id
)
print
(
"vocab_size:"
,
vocab_size
)
...
...
paddlespeech/t2s/exps/fastspeech2/train.py
浏览文件 @
a283f8a5
...
...
@@ -67,7 +67,7 @@ def train_sp(args, config):
if
args
.
speaker_dict
is
not
None
:
print
(
"multiple speaker fastspeech2!"
)
collate_fn
=
fastspeech2_multi_spk_batch_fn
with
open
(
args
.
speaker_dict
,
'rt'
)
as
f
:
with
open
(
args
.
speaker_dict
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
spk_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
spk_num
=
len
(
spk_id
)
fields
+=
[
"spk_id"
]
...
...
@@ -123,7 +123,7 @@ def train_sp(args, config):
num_workers
=
config
.
num_workers
)
print
(
"dataloaders done!"
)
with
open
(
args
.
phones_dict
,
"r"
)
as
f
:
with
open
(
args
.
phones_dict
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
phn_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
vocab_size
=
len
(
phn_id
)
print
(
"vocab_size:"
,
vocab_size
)
...
...
paddlespeech/t2s/exps/speedyspeech/synthesize_e2e.py
浏览文件 @
a283f8a5
...
...
@@ -39,18 +39,18 @@ def evaluate(args, speedyspeech_config, pwg_config):
# construct dataset for evaluation
sentences
=
[]
with
open
(
args
.
text
,
'rt'
)
as
f
:
with
open
(
args
.
text
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
for
line
in
f
:
items
=
line
.
strip
().
split
()
utt_id
=
items
[
0
]
sentence
=
""
.
join
(
items
[
1
:])
sentences
.
append
((
utt_id
,
sentence
))
with
open
(
args
.
phones_dict
,
"r"
)
as
f
:
with
open
(
args
.
phones_dict
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
phn_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
vocab_size
=
len
(
phn_id
)
print
(
"vocab_size:"
,
vocab_size
)
with
open
(
args
.
tones_dict
,
"r"
)
as
f
:
with
open
(
args
.
tones_dict
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
tone_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
tone_size
=
len
(
tone_id
)
print
(
"tone_size:"
,
tone_size
)
...
...
paddlespeech/t2s/exps/speedyspeech/train.py
浏览文件 @
a283f8a5
...
...
@@ -70,7 +70,7 @@ def train_sp(args, config):
if
args
.
speaker_dict
is
not
None
:
print
(
"multiple speaker speedyspeech!"
)
collate_fn
=
speedyspeech_multi_spk_batch_fn
with
open
(
args
.
speaker_dict
,
'rt'
)
as
f
:
with
open
(
args
.
speaker_dict
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
spk_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
spk_num
=
len
(
spk_id
)
fields
+=
[
"spk_id"
]
...
...
@@ -133,11 +133,11 @@ def train_sp(args, config):
collate_fn
=
collate_fn
,
num_workers
=
config
.
num_workers
)
print
(
"dataloaders done!"
)
with
open
(
args
.
phones_dict
,
"r"
)
as
f
:
with
open
(
args
.
phones_dict
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
phn_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
vocab_size
=
len
(
phn_id
)
print
(
"vocab_size:"
,
vocab_size
)
with
open
(
args
.
tones_dict
,
"r"
)
as
f
:
with
open
(
args
.
tones_dict
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
tone_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
tone_size
=
len
(
tone_id
)
print
(
"tone_size:"
,
tone_size
)
...
...
paddlespeech/t2s/exps/syn_utils.py
浏览文件 @
a283f8a5
...
...
@@ -106,7 +106,7 @@ def get_chunks(data, block_size: int, pad_size: int):
def
get_sentences
(
text_file
:
Optional
[
os
.
PathLike
],
lang
:
str
=
'zh'
):
# construct dataset for evaluation
sentences
=
[]
with
open
(
text_file
,
'rt'
)
as
f
:
with
open
(
text_file
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
for
line
in
f
:
if
line
.
strip
()
!=
""
:
items
=
re
.
split
(
r
"\s+"
,
line
.
strip
(),
1
)
...
...
@@ -325,17 +325,17 @@ def get_am_inference(am: str='fastspeech2_csmsc',
tones_dict
:
Optional
[
os
.
PathLike
]
=
None
,
speaker_dict
:
Optional
[
os
.
PathLike
]
=
None
,
return_am
:
bool
=
False
):
with
open
(
phones_dict
,
"r"
)
as
f
:
with
open
(
phones_dict
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
phn_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
vocab_size
=
len
(
phn_id
)
tone_size
=
None
if
tones_dict
is
not
None
:
with
open
(
tones_dict
,
"r"
)
as
f
:
with
open
(
tones_dict
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
tone_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
tone_size
=
len
(
tone_id
)
spk_num
=
None
if
speaker_dict
is
not
None
:
with
open
(
speaker_dict
,
'rt'
)
as
f
:
with
open
(
speaker_dict
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
spk_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
spk_num
=
len
(
spk_id
)
odim
=
am_config
.
n_mels
...
...
paddlespeech/t2s/exps/tacotron2/train.py
浏览文件 @
a283f8a5
...
...
@@ -119,7 +119,7 @@ def train_sp(args, config):
num_workers
=
config
.
num_workers
)
print
(
"dataloaders done!"
)
with
open
(
args
.
phones_dict
,
"r"
)
as
f
:
with
open
(
args
.
phones_dict
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
phn_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
vocab_size
=
len
(
phn_id
)
print
(
"vocab_size:"
,
vocab_size
)
...
...
paddlespeech/t2s/exps/transformer_tts/train.py
浏览文件 @
a283f8a5
...
...
@@ -114,7 +114,7 @@ def train_sp(args, config):
num_workers
=
config
.
num_workers
)
print
(
"dataloaders done!"
)
with
open
(
args
.
phones_dict
,
"r"
)
as
f
:
with
open
(
args
.
phones_dict
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
phn_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
vocab_size
=
len
(
phn_id
)
print
(
"vocab_size:"
,
vocab_size
)
...
...
paddlespeech/t2s/exps/vits/train.py
浏览文件 @
a283f8a5
...
...
@@ -78,7 +78,7 @@ def train_sp(args, config):
if
args
.
speaker_dict
is
not
None
:
print
(
"multiple speaker vits!"
)
collate_fn
=
vits_multi_spk_batch_fn
with
open
(
args
.
speaker_dict
,
'rt'
)
as
f
:
with
open
(
args
.
speaker_dict
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
spk_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
spk_num
=
len
(
spk_id
)
fields
+=
[
"spk_id"
]
...
...
@@ -132,7 +132,7 @@ def train_sp(args, config):
num_workers
=
config
.
num_workers
)
print
(
"dataloaders done!"
)
with
open
(
args
.
phones_dict
,
"r"
)
as
f
:
with
open
(
args
.
phones_dict
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
phn_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
vocab_size
=
len
(
phn_id
)
print
(
"vocab_size:"
,
vocab_size
)
...
...
paddlespeech/t2s/frontend/phonectic.py
浏览文件 @
a283f8a5
...
...
@@ -58,7 +58,7 @@ class English(Phonetics):
self
.
punc
=
":,;。?!“”‘’':,;.?!"
self
.
text_normalizer
=
TextNormalizer
()
if
phone_vocab_path
:
with
open
(
phone_vocab_path
,
'rt'
)
as
f
:
with
open
(
phone_vocab_path
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
phn_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
for
phn
,
id
in
phn_id
:
self
.
vocab_phones
[
phn
]
=
int
(
id
)
...
...
paddlespeech/t2s/frontend/zh_frontend.py
浏览文件 @
a283f8a5
...
...
@@ -144,12 +144,12 @@ class Frontend():
self
.
vocab_phones
=
{}
self
.
vocab_tones
=
{}
if
phone_vocab_path
:
with
open
(
phone_vocab_path
,
'rt'
)
as
f
:
with
open
(
phone_vocab_path
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
phn_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
for
phn
,
id
in
phn_id
:
self
.
vocab_phones
[
phn
]
=
int
(
id
)
if
tone_vocab_path
:
with
open
(
tone_vocab_path
,
'rt'
)
as
f
:
with
open
(
tone_vocab_path
,
'rt'
,
encoding
=
'utf-8'
)
as
f
:
tone_id
=
[
line
.
strip
().
split
()
for
line
in
f
.
readlines
()]
for
tone
,
id
in
tone_id
:
self
.
vocab_tones
[
tone
]
=
int
(
id
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录