Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
c23a97e2
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看板
未验证
提交
c23a97e2
编写于
5月 09, 2022
作者:
H
Hui Zhang
提交者:
GitHub
5月 09, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1877 from Jackwaterveg/develop
[ASR] Replace dist.spawn with dist.launch
上级
5b053cde
8a3c88d4
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
110 addition
and
25 deletion
+110
-25
demos/audio_searching/src/operations/load.py
demos/audio_searching/src/operations/load.py
+3
-2
examples/aishell/asr0/local/train.sh
examples/aishell/asr0/local/train.sh
+9
-0
examples/aishell/asr1/local/train.sh
examples/aishell/asr1/local/train.sh
+11
-0
examples/callcenter/asr1/local/train.sh
examples/callcenter/asr1/local/train.sh
+8
-0
examples/librispeech/asr0/local/train.sh
examples/librispeech/asr0/local/train.sh
+9
-0
examples/librispeech/asr1/local/train.sh
examples/librispeech/asr1/local/train.sh
+8
-0
examples/librispeech/asr2/local/train.sh
examples/librispeech/asr2/local/train.sh
+9
-0
examples/ted_en_zh/st0/local/train.sh
examples/ted_en_zh/st0/local/train.sh
+8
-0
examples/ted_en_zh/st1/local/train.sh
examples/ted_en_zh/st1/local/train.sh
+10
-1
examples/timit/asr1/local/train.sh
examples/timit/asr1/local/train.sh
+8
-0
examples/tiny/asr0/local/train.sh
examples/tiny/asr0/local/train.sh
+10
-0
examples/tiny/asr1/local/train.sh
examples/tiny/asr1/local/train.sh
+11
-0
paddlespeech/s2t/exps/deepspeech2/bin/train.py
paddlespeech/s2t/exps/deepspeech2/bin/train.py
+1
-5
paddlespeech/s2t/exps/u2/bin/train.py
paddlespeech/s2t/exps/u2/bin/train.py
+1
-5
paddlespeech/s2t/exps/u2_kaldi/bin/train.py
paddlespeech/s2t/exps/u2_kaldi/bin/train.py
+1
-5
paddlespeech/s2t/exps/u2_st/bin/train.py
paddlespeech/s2t/exps/u2_st/bin/train.py
+1
-5
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
未找到文件。
demos/audio_searching/src/operations/load.py
浏览文件 @
c23a97e2
...
@@ -26,8 +26,9 @@ def get_audios(path):
...
@@ -26,8 +26,9 @@ def get_audios(path):
"""
"""
supported_formats
=
[
".wav"
,
".mp3"
,
".ogg"
,
".flac"
,
".m4a"
]
supported_formats
=
[
".wav"
,
".mp3"
,
".ogg"
,
".flac"
,
".m4a"
]
return
[
return
[
item
for
sublist
in
[[
os
.
path
.
join
(
dir
,
file
)
for
file
in
files
]
item
for
dir
,
_
,
files
in
list
(
os
.
walk
(
path
))]
for
sublist
in
[[
os
.
path
.
join
(
dir
,
file
)
for
file
in
files
]
for
dir
,
_
,
files
in
list
(
os
.
walk
(
path
))]
for
item
in
sublist
if
os
.
path
.
splitext
(
item
)[
1
]
in
supported_formats
for
item
in
sublist
if
os
.
path
.
splitext
(
item
)[
1
]
in
supported_formats
]
]
...
...
examples/aishell/asr0/local/train.sh
浏览文件 @
c23a97e2
...
@@ -20,12 +20,21 @@ if [ ${seed} != 0 ]; then
...
@@ -20,12 +20,21 @@ if [ ${seed} != 0 ]; then
export
FLAGS_cudnn_deterministic
=
True
export
FLAGS_cudnn_deterministic
=
True
fi
fi
if
[
${
ngpu
}
==
0
]
;
then
python3
-u
${
BIN_DIR
}
/train.py
\
python3
-u
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
--model_type
${
model_type
}
\
--model_type
${
model_type
}
\
--seed
${
seed
}
--seed
${
seed
}
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--model_type
${
model_type
}
\
--seed
${
seed
}
fi
if
[
${
seed
}
!=
0
]
;
then
if
[
${
seed
}
!=
0
]
;
then
unset
FLAGS_cudnn_deterministic
unset
FLAGS_cudnn_deterministic
...
...
examples/aishell/asr1/local/train.sh
浏览文件 @
c23a97e2
...
@@ -27,14 +27,25 @@ ckpt_name=$2
...
@@ -27,14 +27,25 @@ ckpt_name=$2
mkdir
-p
exp
mkdir
-p
exp
if
[
${
ngpu
}
==
0
]
;
then
python3
-u
${
BIN_DIR
}
/train.py
\
python3
-u
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--seed
${
seed
}
\
--seed
${
seed
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--profiler-options
"
${
profiler_options
}
"
\
--benchmark-batch-size
${
benchmark_batch_size
}
\
--benchmark-max-step
${
benchmark_max_step
}
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--seed
${
seed
}
\
--config
${
config_path
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
--profiler-options
"
${
profiler_options
}
"
\
--profiler-options
"
${
profiler_options
}
"
\
--benchmark-batch-size
${
benchmark_batch_size
}
\
--benchmark-batch-size
${
benchmark_batch_size
}
\
--benchmark-max-step
${
benchmark_max_step
}
--benchmark-max-step
${
benchmark_max_step
}
fi
if
[
${
seed
}
!=
0
]
;
then
if
[
${
seed
}
!=
0
]
;
then
...
...
examples/callcenter/asr1/local/train.sh
浏览文件 @
c23a97e2
...
@@ -21,11 +21,19 @@ if [ ${seed} != 0 ]; then
...
@@ -21,11 +21,19 @@ if [ ${seed} != 0 ]; then
export
FLAGS_cudnn_deterministic
=
True
export
FLAGS_cudnn_deterministic
=
True
fi
fi
if
[
${
ngpu
}
==
0
]
;
then
python3
-u
${
BIN_DIR
}
/train.py
\
python3
-u
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
--seed
${
seed
}
--seed
${
seed
}
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--seed
${
seed
}
fi
if
[
${
seed
}
!=
0
]
;
then
if
[
${
seed
}
!=
0
]
;
then
unset
FLAGS_cudnn_deterministic
unset
FLAGS_cudnn_deterministic
...
...
examples/librispeech/asr0/local/train.sh
浏览文件 @
c23a97e2
...
@@ -20,12 +20,21 @@ if [ ${seed} != 0 ]; then
...
@@ -20,12 +20,21 @@ if [ ${seed} != 0 ]; then
export
FLAGS_cudnn_deterministic
=
True
export
FLAGS_cudnn_deterministic
=
True
fi
fi
if
[
${
ngpu
}
==
0
]
;
then
python3
-u
${
BIN_DIR
}
/train.py
\
python3
-u
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
--model_type
${
model_type
}
\
--model_type
${
model_type
}
\
--seed
${
seed
}
--seed
${
seed
}
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--model_type
${
model_type
}
\
--seed
${
seed
}
fi
if
[
${
seed
}
!=
0
]
;
then
if
[
${
seed
}
!=
0
]
;
then
unset
FLAGS_cudnn_deterministic
unset
FLAGS_cudnn_deterministic
...
...
examples/librispeech/asr1/local/train.sh
浏览文件 @
c23a97e2
...
@@ -22,11 +22,19 @@ fi
...
@@ -22,11 +22,19 @@ fi
# export FLAGS_cudnn_exhaustive_search=true
# export FLAGS_cudnn_exhaustive_search=true
# export FLAGS_conv_workspace_size_limit=4000
# export FLAGS_conv_workspace_size_limit=4000
if
[
${
ngpu
}
==
0
]
;
then
python3
-u
${
BIN_DIR
}
/train.py
\
python3
-u
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
--seed
${
seed
}
--seed
${
seed
}
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--seed
${
seed
}
fi
if
[
${
seed
}
!=
0
]
;
then
if
[
${
seed
}
!=
0
]
;
then
unset
FLAGS_cudnn_deterministic
unset
FLAGS_cudnn_deterministic
...
...
examples/librispeech/asr2/local/train.sh
浏览文件 @
c23a97e2
...
@@ -19,12 +19,21 @@ if [ ${seed} != 0 ]; then
...
@@ -19,12 +19,21 @@ if [ ${seed} != 0 ]; then
export
FLAGS_cudnn_deterministic
=
True
export
FLAGS_cudnn_deterministic
=
True
fi
fi
if
[
${
ngpu
}
==
0
]
;
then
python3
-u
${
BIN_DIR
}
/train.py
\
python3
-u
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--model-name
u2_kaldi
\
--model-name
u2_kaldi
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--seed
${
seed
}
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--model-name
u2_kaldi
\
--config
${
config_path
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
--seed
${
seed
}
--seed
${
seed
}
fi
if
[
${
seed
}
!=
0
]
;
then
if
[
${
seed
}
!=
0
]
;
then
unset
FLAGS_cudnn_deterministic
unset
FLAGS_cudnn_deterministic
...
...
examples/ted_en_zh/st0/local/train.sh
浏览文件 @
c23a97e2
...
@@ -19,11 +19,19 @@ if [ ${seed} != 0 ]; then
...
@@ -19,11 +19,19 @@ if [ ${seed} != 0 ]; then
export
FLAGS_cudnn_deterministic
=
True
export
FLAGS_cudnn_deterministic
=
True
fi
fi
if
[
${
ngpu
}
==
0
]
;
then
python3
-u
${
BIN_DIR
}
/train.py
\
python3
-u
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
--seed
${
seed
}
--seed
${
seed
}
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--seed
${
seed
}
fi
if
[
${
seed
}
!=
0
]
;
then
if
[
${
seed
}
!=
0
]
;
then
unset
FLAGS_cudnn_deterministic
unset
FLAGS_cudnn_deterministic
...
...
examples/ted_en_zh/st1/local/train.sh
浏览文件 @
c23a97e2
...
@@ -20,12 +20,21 @@ if [ ${seed} != 0 ]; then
...
@@ -20,12 +20,21 @@ if [ ${seed} != 0 ]; then
export
FLAGS_cudnn_deterministic
=
True
export
FLAGS_cudnn_deterministic
=
True
fi
fi
if
[
${
ngpu
}
==
0
]
;
then
python3
-u
${
BIN_DIR
}
/train.py
\
python3
-u
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
--checkpoint_path
"
${
ckpt_path
}
"
\
--checkpoint_path
"
${
ckpt_path
}
"
\
--seed
${
seed
}
--seed
${
seed
}
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--checkpoint_path
"
${
ckpt_path
}
"
\
--seed
${
seed
}
fi
if
[
${
seed
}
!=
0
]
;
then
if
[
${
seed
}
!=
0
]
;
then
unset
FLAGS_cudnn_deterministic
unset
FLAGS_cudnn_deterministic
...
@@ -36,4 +45,4 @@ if [ $? -ne 0 ]; then
...
@@ -36,4 +45,4 @@ if [ $? -ne 0 ]; then
exit
1
exit
1
fi
fi
exit
0
exit
0
\ No newline at end of file
examples/timit/asr1/local/train.sh
浏览文件 @
c23a97e2
...
@@ -19,11 +19,19 @@ if [ ${seed} != 0 ]; then
...
@@ -19,11 +19,19 @@ if [ ${seed} != 0 ]; then
export
FLAGS_cudnn_deterministic
=
True
export
FLAGS_cudnn_deterministic
=
True
fi
fi
if
[
${
ngpu
}
==
0
]
;
then
python3
-u
${
BIN_DIR
}
/train.py
\
python3
-u
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
--seed
${
seed
}
--seed
${
seed
}
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--seed
${
seed
}
fi
if
[
${
seed
}
!=
0
]
;
then
if
[
${
seed
}
!=
0
]
;
then
unset
FLAGS_cudnn_deterministic
unset
FLAGS_cudnn_deterministic
...
...
examples/tiny/asr0/local/train.sh
浏览文件 @
c23a97e2
...
@@ -26,6 +26,7 @@ model_type=$3
...
@@ -26,6 +26,7 @@ model_type=$3
mkdir
-p
exp
mkdir
-p
exp
if
[
${
ngpu
}
==
0
]
;
then
python3
-u
${
BIN_DIR
}
/train.py
\
python3
-u
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--config
${
config_path
}
\
...
@@ -33,6 +34,15 @@ python3 -u ${BIN_DIR}/train.py \
...
@@ -33,6 +34,15 @@ python3 -u ${BIN_DIR}/train.py \
--model_type
${
model_type
}
\
--model_type
${
model_type
}
\
--profiler-options
"
${
profiler_options
}
"
\
--profiler-options
"
${
profiler_options
}
"
\
--seed
${
seed
}
--seed
${
seed
}
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--model_type
${
model_type
}
\
--profiler-options
"
${
profiler_options
}
"
\
--seed
${
seed
}
fi
if
[
${
seed
}
!=
0
]
;
then
if
[
${
seed
}
!=
0
]
;
then
unset
FLAGS_cudnn_deterministic
unset
FLAGS_cudnn_deterministic
...
...
examples/tiny/asr1/local/train.sh
浏览文件 @
c23a97e2
...
@@ -27,14 +27,25 @@ ckpt_name=$2
...
@@ -27,14 +27,25 @@ ckpt_name=$2
mkdir
-p
exp
mkdir
-p
exp
if
[
${
ngpu
}
==
0
]
;
then
python3
-u
${
BIN_DIR
}
/train.py
\
python3
-u
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--seed
${
seed
}
\
--seed
${
seed
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--profiler-options
"
${
profiler_options
}
"
\
--benchmark-batch-size
${
benchmark_batch_size
}
\
--benchmark-max-step
${
benchmark_max_step
}
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--seed
${
seed
}
\
--config
${
config_path
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
--profiler-options
"
${
profiler_options
}
"
\
--profiler-options
"
${
profiler_options
}
"
\
--benchmark-batch-size
${
benchmark_batch_size
}
\
--benchmark-batch-size
${
benchmark_batch_size
}
\
--benchmark-max-step
${
benchmark_max_step
}
--benchmark-max-step
${
benchmark_max_step
}
fi
if
[
${
seed
}
!=
0
]
;
then
if
[
${
seed
}
!=
0
]
;
then
...
...
paddlespeech/s2t/exps/deepspeech2/bin/train.py
浏览文件 @
c23a97e2
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
"""Trainer for DeepSpeech2 model."""
"""Trainer for DeepSpeech2 model."""
from
paddle
import
distributed
as
dist
from
yacs.config
import
CfgNode
from
yacs.config
import
CfgNode
from
paddlespeech.s2t.exps.deepspeech2.model
import
DeepSpeech2Trainer
as
Trainer
from
paddlespeech.s2t.exps.deepspeech2.model
import
DeepSpeech2Trainer
as
Trainer
...
@@ -27,10 +26,7 @@ def main_sp(config, args):
...
@@ -27,10 +26,7 @@ def main_sp(config, args):
def
main
(
config
,
args
):
def
main
(
config
,
args
):
if
args
.
ngpu
>
1
:
main_sp
(
config
,
args
)
dist
.
spawn
(
main_sp
,
args
=
(
config
,
args
),
nprocs
=
args
.
ngpu
)
else
:
main_sp
(
config
,
args
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
paddlespeech/s2t/exps/u2/bin/train.py
浏览文件 @
c23a97e2
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
import
cProfile
import
cProfile
import
os
import
os
from
paddle
import
distributed
as
dist
from
yacs.config
import
CfgNode
from
yacs.config
import
CfgNode
from
paddlespeech.s2t.exps.u2.model
import
U2Trainer
as
Trainer
from
paddlespeech.s2t.exps.u2.model
import
U2Trainer
as
Trainer
...
@@ -32,10 +31,7 @@ def main_sp(config, args):
...
@@ -32,10 +31,7 @@ def main_sp(config, args):
def
main
(
config
,
args
):
def
main
(
config
,
args
):
if
args
.
ngpu
>
1
:
main_sp
(
config
,
args
)
dist
.
spawn
(
main_sp
,
args
=
(
config
,
args
),
nprocs
=
args
.
ngpu
)
else
:
main_sp
(
config
,
args
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
paddlespeech/s2t/exps/u2_kaldi/bin/train.py
浏览文件 @
c23a97e2
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
import
cProfile
import
cProfile
import
os
import
os
from
paddle
import
distributed
as
dist
from
yacs.config
import
CfgNode
from
yacs.config
import
CfgNode
from
paddlespeech.s2t.training.cli
import
default_argument_parser
from
paddlespeech.s2t.training.cli
import
default_argument_parser
...
@@ -36,10 +35,7 @@ def main_sp(config, args):
...
@@ -36,10 +35,7 @@ def main_sp(config, args):
def
main
(
config
,
args
):
def
main
(
config
,
args
):
if
args
.
ngpu
>
1
:
main_sp
(
config
,
args
)
dist
.
spawn
(
main_sp
,
args
=
(
config
,
args
),
nprocs
=
args
.
ngpu
)
else
:
main_sp
(
config
,
args
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
paddlespeech/s2t/exps/u2_st/bin/train.py
浏览文件 @
c23a97e2
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
import
cProfile
import
cProfile
import
os
import
os
from
paddle
import
distributed
as
dist
from
yacs.config
import
CfgNode
from
yacs.config
import
CfgNode
from
paddlespeech.s2t.exps.u2_st.model
import
U2STTrainer
as
Trainer
from
paddlespeech.s2t.exps.u2_st.model
import
U2STTrainer
as
Trainer
...
@@ -30,10 +29,7 @@ def main_sp(config, args):
...
@@ -30,10 +29,7 @@ def main_sp(config, args):
def
main
(
config
,
args
):
def
main
(
config
,
args
):
if
args
.
ngpu
>
1
:
main_sp
(
config
,
args
)
dist
.
spawn
(
main_sp
,
args
=
(
config
,
args
),
nprocs
=
args
.
ngpu
)
else
:
main_sp
(
config
,
args
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
paddlespeech/s2t/io/sampler.py
浏览文件 @
c23a97e2
...
@@ -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
浏览文件 @
c23a97e2
...
@@ -36,4 +36,4 @@ def repeat(N, fn):
...
@@ -36,4 +36,4 @@ def repeat(N, fn):
Returns:
Returns:
MultiSequential: Repeated model instance.
MultiSequential: 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录