Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
1628e19b
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看板
未验证
提交
1628e19b
编写于
6月 15, 2022
作者:
H
Hui Zhang
提交者:
GitHub
6月 15, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into onnx
上级
b472a148
a37a5266
变更
27
显示空白变更内容
内联
并排
Showing
27 changed file
with
240 addition
and
97 deletion
+240
-97
docs/source/released_model.md
docs/source/released_model.md
+2
-2
examples/aishell/asr0/local/train.sh
examples/aishell/asr0/local/train.sh
+10
-3
examples/aishell/asr0/run.sh
examples/aishell/asr0/run.sh
+2
-1
examples/aishell/asr1/local/train.sh
examples/aishell/asr1/local/train.sh
+11
-3
examples/aishell/asr1/run.sh
examples/aishell/asr1/run.sh
+2
-1
examples/callcenter/asr1/local/train.sh
examples/callcenter/asr1/local/train.sh
+10
-3
examples/callcenter/asr1/run.sh
examples/callcenter/asr1/run.sh
+2
-1
examples/librispeech/asr0/local/train.sh
examples/librispeech/asr0/local/train.sh
+10
-3
examples/librispeech/asr0/run.sh
examples/librispeech/asr0/run.sh
+2
-1
examples/librispeech/asr1/local/test.sh
examples/librispeech/asr1/local/test.sh
+85
-44
examples/librispeech/asr1/local/train.sh
examples/librispeech/asr1/local/train.sh
+10
-3
examples/librispeech/asr1/run.sh
examples/librispeech/asr1/run.sh
+2
-1
examples/librispeech/asr2/local/train.sh
examples/librispeech/asr2/local/train.sh
+10
-3
examples/librispeech/asr2/run.sh
examples/librispeech/asr2/run.sh
+2
-1
examples/mustc/st1/local/train.sh
examples/mustc/st1/local/train.sh
+18
-2
examples/mustc/st1/run.sh
examples/mustc/st1/run.sh
+3
-2
examples/ted_en_zh/st0/local/train.sh
examples/ted_en_zh/st0/local/train.sh
+10
-3
examples/ted_en_zh/st0/run.sh
examples/ted_en_zh/st0/run.sh
+2
-1
examples/ted_en_zh/st1/local/train.sh
examples/ted_en_zh/st1/local/train.sh
+12
-3
examples/ted_en_zh/st1/run.sh
examples/ted_en_zh/st1/run.sh
+2
-1
examples/tiny/asr0/local/train.sh
examples/tiny/asr0/local/train.sh
+10
-3
examples/tiny/asr0/run.sh
examples/tiny/asr0/run.sh
+3
-2
examples/tiny/asr1/local/train.sh
examples/tiny/asr1/local/train.sh
+10
-3
examples/tiny/asr1/run.sh
examples/tiny/asr1/run.sh
+3
-2
paddlespeech/cli/asr/infer.py
paddlespeech/cli/asr/infer.py
+3
-2
paddlespeech/resource/pretrained_models.py
paddlespeech/resource/pretrained_models.py
+2
-2
paddlespeech/server/engine/asr/online/asr_engine.py
paddlespeech/server/engine/asr/online/asr_engine.py
+2
-1
未找到文件。
docs/source/released_model.md
浏览文件 @
1628e19b
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
### Speech Recognition Model
### Speech Recognition Model
Acoustic Model | Training Data | Token-based | Size | Descriptions | CER | WER | Hours of speech | Example Link
Acoustic Model | Training Data | Token-based | Size | Descriptions | CER | WER | Hours of speech | Example Link
:-------------:| :------------:| :-----: | -----: | :-----: |:-----:| :-----: | :-----: | :-----:
:-------------:| :------------:| :-----: | -----: | :-----: |:-----:| :-----: | :-----: | :-----:
[
Ds2 Online Wenetspeech ASR0 Model
](
https://paddlespeech.bj.bcebos.com/s2t/wenetspeech/asr0/asr0_deepspeech2_online_wenetspeech_ckpt_1.0.
0a
.model.tar.gz
)
| Wenetspeech Dataset | Char-based | 1.2 GB | 2 Conv + 5 LSTM layers | 0.152 (test
\_
net, w/o LM)
<br>
0.2417 (test
\_
meeting, w/o LM)
<br>
0.053 (aishell, w/ LM) |-| 10000 h |-
[
Ds2 Online Wenetspeech ASR0 Model
](
https://paddlespeech.bj.bcebos.com/s2t/wenetspeech/asr0/asr0_deepspeech2_online_wenetspeech_ckpt_1.0.
2
.model.tar.gz
)
| Wenetspeech Dataset | Char-based | 1.2 GB | 2 Conv + 5 LSTM layers | 0.152 (test
\_
net, w/o LM)
<br>
0.2417 (test
\_
meeting, w/o LM)
<br>
0.053 (aishell, w/ LM) |-| 10000 h |-
[
Ds2 Online Aishell ASR0 Model
](
https://paddlespeech.bj.bcebos.com/s2t/aishell/asr0/asr0_deepspeech2_online_aishell_fbank161_ckpt_0.2.1.model.tar.gz
)
| Aishell Dataset | Char-based | 491 MB | 2 Conv + 5 LSTM layers | 0.0666 |-| 151 h |
[
D2 Online Aishell ASR0
](
../../examples/aishell/asr0
)
[
Ds2 Online Aishell ASR0 Model
](
https://paddlespeech.bj.bcebos.com/s2t/aishell/asr0/asr0_deepspeech2_online_aishell_fbank161_ckpt_0.2.1.model.tar.gz
)
| Aishell Dataset | Char-based | 491 MB | 2 Conv + 5 LSTM layers | 0.0666 |-| 151 h |
[
D2 Online Aishell ASR0
](
../../examples/aishell/asr0
)
[
Ds2 Offline Aishell ASR0 Model
](
https://paddlespeech.bj.bcebos.com/s2t/aishell/asr0/asr0_deepspeech2_offline_aishell_ckpt_1.0.1.model.tar.gz
)
| Aishell Dataset | Char-based | 1.4 GB | 2 Conv + 5 bidirectional LSTM layers| 0.0554 |-| 151 h |
[
Ds2 Offline Aishell ASR0
](
../../examples/aishell/asr0
)
[
Ds2 Offline Aishell ASR0 Model
](
https://paddlespeech.bj.bcebos.com/s2t/aishell/asr0/asr0_deepspeech2_offline_aishell_ckpt_1.0.1.model.tar.gz
)
| Aishell Dataset | Char-based | 1.4 GB | 2 Conv + 5 bidirectional LSTM layers| 0.0554 |-| 151 h |
[
Ds2 Offline Aishell ASR0
](
../../examples/aishell/asr0
)
[
Conformer Online Wenetspeech ASR1 Model
](
https://paddlespeech.bj.bcebos.com/s2t/wenetspeech/asr1/asr1_chunk_conformer_wenetspeech_ckpt_1.0.0a.model.tar.gz
)
| WenetSpeech Dataset | Char-based | 457 MB | Encoder:Conformer, Decoder:Transformer, Decoding method: Attention rescoring| 0.11 (test
\_
net) 0.1879 (test
\_
meeting) |-| 10000 h |-
[
Conformer Online Wenetspeech ASR1 Model
](
https://paddlespeech.bj.bcebos.com/s2t/wenetspeech/asr1/asr1_chunk_conformer_wenetspeech_ckpt_1.0.0a.model.tar.gz
)
| WenetSpeech Dataset | Char-based | 457 MB | Encoder:Conformer, Decoder:Transformer, Decoding method: Attention rescoring| 0.11 (test
\_
net) 0.1879 (test
\_
meeting) |-| 10000 h |-
...
@@ -14,7 +14,7 @@ Acoustic Model | Training Data | Token-based | Size | Descriptions | CER | WER |
...
@@ -14,7 +14,7 @@ Acoustic Model | Training Data | Token-based | Size | Descriptions | CER | WER |
[
Conformer Offline Aishell ASR1 Model
](
https://paddlespeech.bj.bcebos.com/s2t/aishell/asr1/asr1_conformer_aishell_ckpt_0.1.2.model.tar.gz
)
| Aishell Dataset | Char-based | 189 MB | Encoder:Conformer, Decoder:Transformer, Decoding method: Attention rescoring | 0.0464 |-| 151 h |
[
Conformer Offline Aishell ASR1
](
../../examples/aishell/asr1
)
[
Conformer Offline Aishell ASR1 Model
](
https://paddlespeech.bj.bcebos.com/s2t/aishell/asr1/asr1_conformer_aishell_ckpt_0.1.2.model.tar.gz
)
| Aishell Dataset | Char-based | 189 MB | Encoder:Conformer, Decoder:Transformer, Decoding method: Attention rescoring | 0.0464 |-| 151 h |
[
Conformer Offline Aishell ASR1
](
../../examples/aishell/asr1
)
[
Transformer Aishell ASR1 Model
](
https://paddlespeech.bj.bcebos.com/s2t/aishell/asr1/asr1_transformer_aishell_ckpt_0.1.1.model.tar.gz
)
| Aishell Dataset | Char-based | 128 MB | Encoder:Transformer, Decoder:Transformer, Decoding method: Attention rescoring | 0.0523 || 151 h |
[
Transformer Aishell ASR1
](
../../examples/aishell/asr1
)
[
Transformer Aishell ASR1 Model
](
https://paddlespeech.bj.bcebos.com/s2t/aishell/asr1/asr1_transformer_aishell_ckpt_0.1.1.model.tar.gz
)
| Aishell Dataset | Char-based | 128 MB | Encoder:Transformer, Decoder:Transformer, Decoding method: Attention rescoring | 0.0523 || 151 h |
[
Transformer Aishell ASR1
](
../../examples/aishell/asr1
)
[
Ds2 Offline Librispeech ASR0 Model
](
https://paddlespeech.bj.bcebos.com/s2t/librispeech/asr0/asr0_deepspeech2_offline_librispeech_ckpt_1.0.1.model.tar.gz
)
| Librispeech Dataset | Char-based | 1.3 GB | 2 Conv + 5 bidirectional LSTM layers| - |0.0467| 960 h |
[
Ds2 Offline Librispeech ASR0
](
../../examples/librispeech/asr0
)
[
Ds2 Offline Librispeech ASR0 Model
](
https://paddlespeech.bj.bcebos.com/s2t/librispeech/asr0/asr0_deepspeech2_offline_librispeech_ckpt_1.0.1.model.tar.gz
)
| Librispeech Dataset | Char-based | 1.3 GB | 2 Conv + 5 bidirectional LSTM layers| - |0.0467| 960 h |
[
Ds2 Offline Librispeech ASR0
](
../../examples/librispeech/asr0
)
[
Conformer Librispeech ASR1 Model
](
https://paddlespeech.bj.bcebos.com/s2t/librispeech/asr1/asr1_conformer_librispeech_ckpt_0.1.1.model.tar.gz
)
| Librispeech Dataset | subword-based | 191 MB | Encoder:Conformer, Decoder:Transformer, Decoding method: Attention rescoring |-| 0.033
7
| 960 h |
[
Conformer Librispeech ASR1
](
../../examples/librispeech/asr1
)
[
Conformer Librispeech ASR1 Model
](
https://paddlespeech.bj.bcebos.com/s2t/librispeech/asr1/asr1_conformer_librispeech_ckpt_0.1.1.model.tar.gz
)
| Librispeech Dataset | subword-based | 191 MB | Encoder:Conformer, Decoder:Transformer, Decoding method: Attention rescoring |-| 0.033
8
| 960 h |
[
Conformer Librispeech ASR1
](
../../examples/librispeech/asr1
)
[
Transformer Librispeech ASR1 Model
](
https://paddlespeech.bj.bcebos.com/s2t/librispeech/asr1/asr1_transformer_librispeech_ckpt_0.1.1.model.tar.gz
)
| Librispeech Dataset | subword-based | 131 MB | Encoder:Transformer, Decoder:Transformer, Decoding method: Attention rescoring |-| 0.0381 | 960 h |
[
Transformer Librispeech ASR1
](
../../examples/librispeech/asr1
)
[
Transformer Librispeech ASR1 Model
](
https://paddlespeech.bj.bcebos.com/s2t/librispeech/asr1/asr1_transformer_librispeech_ckpt_0.1.1.model.tar.gz
)
| Librispeech Dataset | subword-based | 131 MB | Encoder:Transformer, Decoder:Transformer, Decoding method: Attention rescoring |-| 0.0381 | 960 h |
[
Transformer Librispeech ASR1
](
../../examples/librispeech/asr1
)
[
Transformer Librispeech ASR2 Model
](
https://paddlespeech.bj.bcebos.com/s2t/librispeech/asr2/asr2_transformer_librispeech_ckpt_0.1.1.model.tar.gz
)
| Librispeech Dataset | subword-based | 131 MB | Encoder:Transformer, Decoder:Transformer, Decoding method: JoinCTC w/ LM |-| 0.0240 | 960 h |
[
Transformer Librispeech ASR2
](
../../examples/librispeech/asr2
)
[
Transformer Librispeech ASR2 Model
](
https://paddlespeech.bj.bcebos.com/s2t/librispeech/asr2/asr2_transformer_librispeech_ckpt_0.1.1.model.tar.gz
)
| Librispeech Dataset | subword-based | 131 MB | Encoder:Transformer, Decoder:Transformer, Decoding method: JoinCTC w/ LM |-| 0.0240 | 960 h |
[
Transformer Librispeech ASR2
](
../../examples/librispeech/asr2
)
...
...
examples/aishell/asr0/local/train.sh
浏览文件 @
1628e19b
#!/bin/bash
#!/bin/bash
if
[
$#
!=
2
]
;
then
if
[
$#
-lt
2
]
&&
[
$#
-gt
3
]
;
then
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name"
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name
ips(optional)
"
exit
-1
exit
-1
fi
fi
...
@@ -10,6 +10,13 @@ echo "using $ngpu gpus..."
...
@@ -10,6 +10,13 @@ echo "using $ngpu gpus..."
config_path
=
$1
config_path
=
$1
ckpt_name
=
$2
ckpt_name
=
$2
ips
=
$3
if
[
!
$ips
]
;
then
ips_config
=
else
ips_config
=
"--ips="
${
ips
}
fi
mkdir
-p
exp
mkdir
-p
exp
...
@@ -26,7 +33,7 @@ python3 -u ${BIN_DIR}/train.py \
...
@@ -26,7 +33,7 @@ python3 -u ${BIN_DIR}/train.py \
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
--seed
${
seed
}
--seed
${
seed
}
else
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
ips_config
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
...
...
examples/aishell/asr0/run.sh
浏览文件 @
1628e19b
...
@@ -6,6 +6,7 @@ gpus=0,1,2,3
...
@@ -6,6 +6,7 @@ gpus=0,1,2,3
stage
=
0
stage
=
0
stop_stage
=
100
stop_stage
=
100
conf_path
=
conf/deepspeech2.yaml
#conf/deepspeech2.yaml or conf/deepspeech2_online.yaml
conf_path
=
conf/deepspeech2.yaml
#conf/deepspeech2.yaml or conf/deepspeech2_online.yaml
ips
=
#xx.xx.xx.xx,xx.xx.xx.xx
decode_conf_path
=
conf/tuning/decode.yaml
decode_conf_path
=
conf/tuning/decode.yaml
avg_num
=
10
avg_num
=
10
audio_file
=
data/demo_01_03.wav
audio_file
=
data/demo_01_03.wav
...
@@ -24,7 +25,7 @@ fi
...
@@ -24,7 +25,7 @@ fi
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
# train model, all `ckpt` under `exp` dir
# train model, all `ckpt` under `exp` dir
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
${
ips
}
fi
fi
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
...
...
examples/aishell/asr1/local/train.sh
浏览文件 @
1628e19b
...
@@ -17,13 +17,21 @@ if [ ${seed} != 0 ]; then
...
@@ -17,13 +17,21 @@ if [ ${seed} != 0 ]; then
echo
"using seed
$seed
& FLAGS_cudnn_deterministic=True ..."
echo
"using seed
$seed
& FLAGS_cudnn_deterministic=True ..."
fi
fi
if
[
$#
!=
2
]
;
then
if
[
$#
-lt
2
]
&&
[
$#
-gt
3
]
;
then
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name"
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name
ips(optional)
"
exit
-1
exit
-1
fi
fi
config_path
=
$1
config_path
=
$1
ckpt_name
=
$2
ckpt_name
=
$2
ips
=
$3
if
[
!
$ips
]
;
then
ips_config
=
else
ips_config
=
"--ips="
${
ips
}
fi
echo
${
ips_config
}
mkdir
-p
exp
mkdir
-p
exp
...
@@ -37,7 +45,7 @@ python3 -u ${BIN_DIR}/train.py \
...
@@ -37,7 +45,7 @@ python3 -u ${BIN_DIR}/train.py \
--benchmark-batch-size
${
benchmark_batch_size
}
\
--benchmark-batch-size
${
benchmark_batch_size
}
\
--benchmark-max-step
${
benchmark_max_step
}
--benchmark-max-step
${
benchmark_max_step
}
else
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
ips_config
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--seed
${
seed
}
\
--seed
${
seed
}
\
--config
${
config_path
}
\
--config
${
config_path
}
\
...
...
examples/aishell/asr1/run.sh
浏览文件 @
1628e19b
...
@@ -6,6 +6,7 @@ gpus=0,1,2,3
...
@@ -6,6 +6,7 @@ gpus=0,1,2,3
stage
=
0
stage
=
0
stop_stage
=
50
stop_stage
=
50
conf_path
=
conf/conformer.yaml
conf_path
=
conf/conformer.yaml
ips
=
#xx.xx.xx.xx,xx.xx.xx.xx
decode_conf_path
=
conf/tuning/decode.yaml
decode_conf_path
=
conf/tuning/decode.yaml
avg_num
=
30
avg_num
=
30
audio_file
=
data/demo_01_03.wav
audio_file
=
data/demo_01_03.wav
...
@@ -23,7 +24,7 @@ fi
...
@@ -23,7 +24,7 @@ fi
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
# train model, all `ckpt` under `exp` dir
# train model, all `ckpt` under `exp` dir
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
${
ips
}
fi
fi
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
...
...
examples/callcenter/asr1/local/train.sh
浏览文件 @
1628e19b
#! /usr/bin/env bash
#! /usr/bin/env bash
if
[
$#
!=
2
]
;
then
if
[
$#
-lt
2
]
&&
[
$#
-gt
3
]
;
then
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name"
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name
ips(optional)
"
exit
-1
exit
-1
fi
fi
...
@@ -10,6 +10,13 @@ echo "using $ngpu gpus..."
...
@@ -10,6 +10,13 @@ echo "using $ngpu gpus..."
config_path
=
$1
config_path
=
$1
ckpt_name
=
$2
ckpt_name
=
$2
ips
=
$3
if
[
!
$ips
]
;
then
ips_config
=
else
ips_config
=
"--ips="
${
ips
}
fi
echo
"using
${
device
}
..."
echo
"using
${
device
}
..."
...
@@ -28,7 +35,7 @@ python3 -u ${BIN_DIR}/train.py \
...
@@ -28,7 +35,7 @@ python3 -u ${BIN_DIR}/train.py \
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
--seed
${
seed
}
--seed
${
seed
}
else
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
ips_config
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
...
...
examples/callcenter/asr1/run.sh
浏览文件 @
1628e19b
...
@@ -6,6 +6,7 @@ gpus=0,1,2,3
...
@@ -6,6 +6,7 @@ gpus=0,1,2,3
stage
=
0
stage
=
0
stop_stage
=
50
stop_stage
=
50
conf_path
=
conf/conformer.yaml
conf_path
=
conf/conformer.yaml
ips
=
#xx.xx.xx.xx,xx.xx.xx.xx
decode_conf_path
=
conf/tuning/decode.yaml
decode_conf_path
=
conf/tuning/decode.yaml
avg_num
=
20
avg_num
=
20
...
@@ -22,7 +23,7 @@ fi
...
@@ -22,7 +23,7 @@ fi
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
# train model, all `ckpt` under `exp` dir
# train model, all `ckpt` under `exp` dir
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
${
ips
}
fi
fi
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
...
...
examples/librispeech/asr0/local/train.sh
浏览文件 @
1628e19b
#!/bin/bash
#!/bin/bash
if
[
$#
!=
2
]
;
then
if
[
$#
-lt
2
]
&&
[
$#
-gt
3
]
;
then
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name"
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name
ips(optional)
"
exit
-1
exit
-1
fi
fi
...
@@ -10,6 +10,13 @@ echo "using $ngpu gpus..."
...
@@ -10,6 +10,13 @@ echo "using $ngpu gpus..."
config_path
=
$1
config_path
=
$1
ckpt_name
=
$2
ckpt_name
=
$2
ips
=
$3
if
[
!
$ips
]
;
then
ips_config
=
else
ips_config
=
"--ips="
${
ips
}
fi
mkdir
-p
exp
mkdir
-p
exp
...
@@ -26,7 +33,7 @@ python3 -u ${BIN_DIR}/train.py \
...
@@ -26,7 +33,7 @@ python3 -u ${BIN_DIR}/train.py \
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
--seed
${
seed
}
--seed
${
seed
}
else
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
ips_config
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
...
...
examples/librispeech/asr0/run.sh
浏览文件 @
1628e19b
...
@@ -6,6 +6,7 @@ gpus=0,1,2,3
...
@@ -6,6 +6,7 @@ gpus=0,1,2,3
stage
=
0
stage
=
0
stop_stage
=
100
stop_stage
=
100
conf_path
=
conf/deepspeech2.yaml
conf_path
=
conf/deepspeech2.yaml
ips
=
#xx.xx.xx.xx,xx.xx.xx.xx
decode_conf_path
=
conf/tuning/decode.yaml
decode_conf_path
=
conf/tuning/decode.yaml
avg_num
=
5
avg_num
=
5
audio_file
=
data/demo_002_en.wav
audio_file
=
data/demo_002_en.wav
...
@@ -23,7 +24,7 @@ fi
...
@@ -23,7 +24,7 @@ fi
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
# train model, all `ckpt` under `exp` dir
# train model, all `ckpt` under `exp` dir
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
${
ips
}
fi
fi
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
...
...
examples/librispeech/asr1/local/test.sh
浏览文件 @
1628e19b
...
@@ -42,6 +42,11 @@ echo "chunk mode ${chunk_mode}"
...
@@ -42,6 +42,11 @@ echo "chunk mode ${chunk_mode}"
if
[
${
stage
}
-le
0
]
&&
[
${
stop_stage
}
-ge
0
]
;
then
if
[
${
stage
}
-le
0
]
&&
[
${
stop_stage
}
-ge
0
]
;
then
# format the reference test file
python3 utils/format_rsl.py
\
--origin_ref
data/manifest.test-clean.raw
\
--trans_ref
data/manifest.test-clean.text
for
type
in
attention
;
do
for
type
in
attention
;
do
echo
"decoding
${
type
}
"
echo
"decoding
${
type
}
"
if
[
${
chunk_mode
}
==
true
]
;
then
if
[
${
chunk_mode
}
==
true
]
;
then
...
@@ -63,11 +68,16 @@ if [ ${stage} -le 0 ] && [ ${stop_stage} -ge 0 ]; then
...
@@ -63,11 +68,16 @@ if [ ${stage} -le 0 ] && [ ${stop_stage} -ge 0 ]; then
echo
"Failed in evaluation!"
echo
"Failed in evaluation!"
exit
1
exit
1
fi
fi
python3 utils/format_rsl.py
\
--origin_hyp
${
ckpt_prefix
}
.
${
type
}
.rsl
\
--trans_hyp
${
ckpt_prefix
}
.
${
type
}
.rsl.text
python3 utils/compute-wer.py
--char
=
1
--v
=
1
\
data/manifest.test-clean.text
${
ckpt_prefix
}
.
${
type
}
.rsl.text
>
${
ckpt_prefix
}
.
${
type
}
.error
echo
"decoding
${
type
}
done."
echo
"decoding
${
type
}
done."
done
done
fi
for
type
in
ctc_greedy_search
;
do
for
type
in
ctc_greedy_search
;
do
echo
"decoding
${
type
}
"
echo
"decoding
${
type
}
"
if
[
${
chunk_mode
}
==
true
]
;
then
if
[
${
chunk_mode
}
==
true
]
;
then
# stream decoding only support batchsize=1
# stream decoding only support batchsize=1
...
@@ -88,12 +98,18 @@ for type in ctc_greedy_search; do
...
@@ -88,12 +98,18 @@ for type in ctc_greedy_search; do
echo
"Failed in evaluation!"
echo
"Failed in evaluation!"
exit
1
exit
1
fi
fi
python3 utils/format_rsl.py
\
--origin_hyp
${
ckpt_prefix
}
.
${
type
}
.rsl
\
--trans_hyp
${
ckpt_prefix
}
.
${
type
}
.rsl.text
python3 utils/compute-wer.py
--char
=
1
--v
=
1
\
data/manifest.test-clean.text
${
ckpt_prefix
}
.
${
type
}
.rsl.text
>
${
ckpt_prefix
}
.
${
type
}
.error
echo
"decoding
${
type
}
done."
echo
"decoding
${
type
}
done."
done
done
for
type
in
ctc_prefix_beam_search attention_rescoring
;
do
for
type
in
ctc_prefix_beam_search attention_rescoring
;
do
echo
"decoding
${
type
}
"
echo
"decoding
${
type
}
"
batch_size
=
1
batch_size
=
1
python3
-u
${
BIN_DIR
}
/test.py
\
python3
-u
${
BIN_DIR
}
/test.py
\
...
@@ -109,8 +125,33 @@ for type in ctc_prefix_beam_search attention_rescoring; do
...
@@ -109,8 +125,33 @@ for type in ctc_prefix_beam_search attention_rescoring; do
echo
"Failed in evaluation!"
echo
"Failed in evaluation!"
exit
1
exit
1
fi
fi
python3 utils/format_rsl.py
\
--origin_hyp
${
ckpt_prefix
}
.
${
type
}
.rsl
\
--trans_hyp
${
ckpt_prefix
}
.
${
type
}
.rsl.text
python3 utils/compute-wer.py
--char
=
1
--v
=
1
\
data/manifest.test-clean.text
${
ckpt_prefix
}
.
${
type
}
.rsl.text
>
${
ckpt_prefix
}
.
${
type
}
.error
echo
"decoding
${
type
}
done."
echo
"decoding
${
type
}
done."
done
done
fi
if
[
${
stage
}
-le
101
]
&&
[
${
stop_stage
}
-ge
101
]
;
then
python3 utils/format_rsl.py
\
--origin_ref
data/manifest.test-clean.raw
\
--trans_ref_sclite
data/manifest.test.text-clean.sclite
output_dir
=
${
ckpt_prefix
}
for
type
in
attention ctc_greedy_search ctc_prefix_beam_search attention_rescoring
;
do
python utils/format_rsl.py
\
--origin_hyp
${
output_dir
}
/
${
type
}
.rsl
\
--trans_hyp_sclite
${
output_dir
}
/
${
type
}
.rsl.text.sclite
mkdir
-p
${
output_dir
}
/
${
type
}
_sclite
sclite
-i
wsj
-r
data/manifest.test-clean.text.sclite
-h
${
output_dir
}
/
${
type
}
.rsl.text.sclite
-e
utf-8
-o
all
-O
${
output_dir
}
/
${
type
}
_sclite
-c
NOASCII
done
fi
echo
"Finished"
echo
"Finished"
...
...
examples/librispeech/asr1/local/train.sh
浏览文件 @
1628e19b
#!/bin/bash
#!/bin/bash
if
[
$#
!=
2
]
;
then
if
[
$#
-lt
2
]
&&
[
$#
-gt
3
]
;
then
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name"
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name
ips(optional)
"
exit
-1
exit
-1
fi
fi
...
@@ -10,6 +10,13 @@ echo "using $ngpu gpus..."
...
@@ -10,6 +10,13 @@ echo "using $ngpu gpus..."
config_path
=
$1
config_path
=
$1
ckpt_name
=
$2
ckpt_name
=
$2
ips
=
$3
if
[
!
$ips
]
;
then
ips_config
=
else
ips_config
=
"--ips="
${
ips
}
fi
mkdir
-p
exp
mkdir
-p
exp
...
@@ -29,7 +36,7 @@ python3 -u ${BIN_DIR}/train.py \
...
@@ -29,7 +36,7 @@ python3 -u ${BIN_DIR}/train.py \
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
--seed
${
seed
}
--seed
${
seed
}
else
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
ips_config
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
...
...
examples/librispeech/asr1/run.sh
浏览文件 @
1628e19b
...
@@ -8,6 +8,7 @@ gpus=0,1,2,3
...
@@ -8,6 +8,7 @@ gpus=0,1,2,3
stage
=
0
stage
=
0
stop_stage
=
50
stop_stage
=
50
conf_path
=
conf/transformer.yaml
conf_path
=
conf/transformer.yaml
ips
=
#xx.xx.xx.xx,xx.xx.xx.xx
decode_conf_path
=
conf/tuning/decode.yaml
decode_conf_path
=
conf/tuning/decode.yaml
avg_num
=
30
avg_num
=
30
audio_file
=
data/demo_002_en.wav
audio_file
=
data/demo_002_en.wav
...
@@ -25,7 +26,7 @@ fi
...
@@ -25,7 +26,7 @@ fi
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
# train model, all `ckpt` under `exp` dir
# train model, all `ckpt` under `exp` dir
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
${
ips
}
fi
fi
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
...
...
examples/librispeech/asr2/local/train.sh
浏览文件 @
1628e19b
#!/bin/bash
#!/bin/bash
if
[
$#
!=
2
]
;
then
if
[
$#
-lt
2
]
&&
[
$#
-gt
3
]
;
then
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name"
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name
ips(optional)
"
exit
-1
exit
-1
fi
fi
...
@@ -10,6 +10,13 @@ echo "using $ngpu gpus..."
...
@@ -10,6 +10,13 @@ echo "using $ngpu gpus..."
config_path
=
$1
config_path
=
$1
ckpt_name
=
$2
ckpt_name
=
$2
ips
=
$3
if
[
!
$ips
]
;
then
ips_config
=
else
ips_config
=
"--ips="
${
ips
}
fi
mkdir
-p
exp
mkdir
-p
exp
...
@@ -27,7 +34,7 @@ python3 -u ${BIN_DIR}/train.py \
...
@@ -27,7 +34,7 @@ python3 -u ${BIN_DIR}/train.py \
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
--seed
${
seed
}
--seed
${
seed
}
else
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
ips_config
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--model-name
u2_kaldi
\
--model-name
u2_kaldi
\
--config
${
config_path
}
\
--config
${
config_path
}
\
...
...
examples/librispeech/asr2/run.sh
浏览文件 @
1628e19b
...
@@ -9,6 +9,7 @@ gpus=0,1,2,3,4,5,6,7
...
@@ -9,6 +9,7 @@ gpus=0,1,2,3,4,5,6,7
stage
=
0
stage
=
0
stop_stage
=
50
stop_stage
=
50
conf_path
=
conf/transformer.yaml
conf_path
=
conf/transformer.yaml
ips
=
#xx.xx.xx.xx,xx.xx.xx.xx
decode_conf_path
=
conf/decode/decode_base.yaml
decode_conf_path
=
conf/decode/decode_base.yaml
dict_path
=
data/lang_char/train_960_unigram5000_units.txt
dict_path
=
data/lang_char/train_960_unigram5000_units.txt
avg_num
=
10
avg_num
=
10
...
@@ -26,7 +27,7 @@ fi
...
@@ -26,7 +27,7 @@ fi
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
# train model, all `ckpt` under `exp` dir
# train model, all `ckpt` under `exp` dir
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
${
ips
}
fi
fi
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
...
...
examples/mustc/st1/local/train.sh
浏览文件 @
1628e19b
#!/bin/bash
#!/bin/bash
if
[
$#
!=
3
]
;
then
if
[
$#
-lt
3
]
&&
[
$#
-gt
4
]
;
then
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name ckpt_path"
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name ckpt_path
ips(optional)
"
exit
-1
exit
-1
fi
fi
...
@@ -11,6 +11,13 @@ echo "using $ngpu gpus..."
...
@@ -11,6 +11,13 @@ echo "using $ngpu gpus..."
config_path
=
$1
config_path
=
$1
ckpt_name
=
$2
ckpt_name
=
$2
ckpt_path
=
$3
ckpt_path
=
$3
ips
=
$3
if
[
!
$ips
]
;
then
ips_config
=
else
ips_config
=
"--ips="
${
ips
}
fi
mkdir
-p
exp
mkdir
-p
exp
...
@@ -21,12 +28,21 @@ if [ ${seed} != 0 ]; then
...
@@ -21,12 +28,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
}
${
ips_config
}
${
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
...
...
examples/mustc/st1/run.sh
浏览文件 @
1628e19b
...
@@ -7,6 +7,7 @@ gpus=0,1,2,3
...
@@ -7,6 +7,7 @@ gpus=0,1,2,3
stage
=
0
stage
=
0
stop_stage
=
3
stop_stage
=
3
conf_path
=
conf/transformer_es.yaml
conf_path
=
conf/transformer_es.yaml
ips
=
#xx.xx.xx.xx,xx.xx.xx.xx
decode_conf_path
=
conf/tuning/decode.yaml
decode_conf_path
=
conf/tuning/decode.yaml
must_c_path
=
must_c_path
=
lang
=
es
lang
=
es
...
@@ -25,7 +26,7 @@ fi
...
@@ -25,7 +26,7 @@ fi
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
# train model, all `ckpt` under `exp` dir
# train model, all `ckpt` under `exp` dir
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
"
${
ckpt_path
}
"
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
"
${
ckpt_path
}
"
${
ips
}
fi
fi
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
...
...
examples/ted_en_zh/st0/local/train.sh
浏览文件 @
1628e19b
#!/bin/bash
#!/bin/bash
if
[
$#
!=
2
]
;
then
if
[
$#
-lt
2
]
&&
[
$#
-gt
3
]
;
then
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name"
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name
ips(optional)
"
exit
-1
exit
-1
fi
fi
...
@@ -10,6 +10,13 @@ echo "using $ngpu gpus..."
...
@@ -10,6 +10,13 @@ echo "using $ngpu gpus..."
config_path
=
$1
config_path
=
$1
ckpt_name
=
$2
ckpt_name
=
$2
ips
=
$3
if
[
!
$ips
]
;
then
ips_config
=
else
ips_config
=
"--ips="
${
ips
}
fi
mkdir
-p
exp
mkdir
-p
exp
...
@@ -26,7 +33,7 @@ python3 -u ${BIN_DIR}/train.py \
...
@@ -26,7 +33,7 @@ python3 -u ${BIN_DIR}/train.py \
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
--seed
${
seed
}
--seed
${
seed
}
else
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
ips_config
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
...
...
examples/ted_en_zh/st0/run.sh
浏览文件 @
1628e19b
...
@@ -6,6 +6,7 @@ gpus=0,1,2,3
...
@@ -6,6 +6,7 @@ gpus=0,1,2,3
stage
=
0
stage
=
0
stop_stage
=
50
stop_stage
=
50
conf_path
=
conf/transformer_mtl_noam.yaml
conf_path
=
conf/transformer_mtl_noam.yaml
ips
=
#xx.xx.xx.xx,xx.xx.xx.xx
decode_conf_path
=
conf/tuning/decode.yaml
decode_conf_path
=
conf/tuning/decode.yaml
avg_num
=
5
avg_num
=
5
data_path
=
./TED_EnZh
# path to unzipped data
data_path
=
./TED_EnZh
# path to unzipped data
...
@@ -23,7 +24,7 @@ fi
...
@@ -23,7 +24,7 @@ fi
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
# train model, all `ckpt` under `exp` dir
# train model, all `ckpt` under `exp` dir
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
${
ips
}
fi
fi
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
...
...
examples/ted_en_zh/st1/local/train.sh
浏览文件 @
1628e19b
#!/bin/bash
#!/bin/bash
if
[
$#
!=
3
]
;
then
if
[
$#
-lt
3
]
&&
[
$#
-gt
4
]
;
then
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name
ckpt_path
"
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name
ips(optional)
"
exit
-1
exit
-1
fi
fi
...
@@ -11,6 +11,15 @@ echo "using $ngpu gpus..."
...
@@ -11,6 +11,15 @@ echo "using $ngpu gpus..."
config_path
=
$1
config_path
=
$1
ckpt_name
=
$2
ckpt_name
=
$2
ckpt_path
=
$3
ckpt_path
=
$3
ips
=
$3
if
[
!
$ips
]
;
then
ips_config
=
else
ips_config
=
"--ips="
${
ips
}
fi
mkdir
-p
exp
mkdir
-p
exp
mkdir
-p
exp
...
@@ -28,7 +37,7 @@ python3 -u ${BIN_DIR}/train.py \
...
@@ -28,7 +37,7 @@ python3 -u ${BIN_DIR}/train.py \
--checkpoint_path
"
${
ckpt_path
}
"
\
--checkpoint_path
"
${
ckpt_path
}
"
\
--seed
${
seed
}
--seed
${
seed
}
else
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
ips_config
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
...
...
examples/ted_en_zh/st1/run.sh
浏览文件 @
1628e19b
...
@@ -7,6 +7,7 @@ gpus=0,1,2,3
...
@@ -7,6 +7,7 @@ gpus=0,1,2,3
stage
=
1
stage
=
1
stop_stage
=
4
stop_stage
=
4
conf_path
=
conf/transformer_mtl_noam.yaml
conf_path
=
conf/transformer_mtl_noam.yaml
ips
=
#xx.xx.xx.xx,xx.xx.xx.xx
decode_conf_path
=
conf/tuning/decode.yaml
decode_conf_path
=
conf/tuning/decode.yaml
ckpt_path
=
# paddle.98 # (finetune from FAT-ST pretrained model)
ckpt_path
=
# paddle.98 # (finetune from FAT-ST pretrained model)
avg_num
=
5
avg_num
=
5
...
@@ -29,7 +30,7 @@ if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then
...
@@ -29,7 +30,7 @@ if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then
echo
"Finetune from Pretrained Model"
${
ckpt_path
}
echo
"Finetune from Pretrained Model"
${
ckpt_path
}
./local/download_pretrain.sh
||
exit
-1
./local/download_pretrain.sh
||
exit
-1
fi
fi
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
"
${
ckpt_path
}
"
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
"
${
ckpt_path
}
"
${
ips
}
fi
fi
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
...
...
examples/tiny/asr0/local/train.sh
浏览文件 @
1628e19b
...
@@ -15,13 +15,20 @@ if [ ${seed} != 0 ]; then
...
@@ -15,13 +15,20 @@ if [ ${seed} != 0 ]; then
echo
"using seed
$seed
& FLAGS_cudnn_deterministic=True ..."
echo
"using seed
$seed
& FLAGS_cudnn_deterministic=True ..."
fi
fi
if
[
$#
!=
2
]
;
then
if
[
$#
-lt
2
]
&&
[
$#
-gt
3
]
;
then
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name"
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name
ips(optional)
"
exit
-1
exit
-1
fi
fi
config_path
=
$1
config_path
=
$1
ckpt_name
=
$2
ckpt_name
=
$2
ips
=
$3
if
[
!
$ips
]
;
then
ips_config
=
else
ips_config
=
"--ips="
${
ips
}
fi
mkdir
-p
exp
mkdir
-p
exp
...
@@ -33,7 +40,7 @@ python3 -u ${BIN_DIR}/train.py \
...
@@ -33,7 +40,7 @@ python3 -u ${BIN_DIR}/train.py \
--profiler-options
"
${
profiler_options
}
"
\
--profiler-options
"
${
profiler_options
}
"
\
--seed
${
seed
}
--seed
${
seed
}
else
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
ips_config
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--config
${
config_path
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
\
--output
exp/
${
ckpt_name
}
\
...
...
examples/tiny/asr0/run.sh
浏览文件 @
1628e19b
...
@@ -2,10 +2,11 @@
...
@@ -2,10 +2,11 @@
set
-e
set
-e
source
path.sh
source
path.sh
gpus
=
0
gpus
=
4
stage
=
0
stage
=
0
stop_stage
=
100
stop_stage
=
100
conf_path
=
conf/deepspeech2.yaml
conf_path
=
conf/deepspeech2.yaml
ips
=
#xx.xx.xx.xx,xx.xx.xx.xx
decode_conf_path
=
conf/tuning/decode.yaml
decode_conf_path
=
conf/tuning/decode.yaml
avg_num
=
1
avg_num
=
1
source
${
MAIN_ROOT
}
/utils/parse_options.sh
||
exit
1
;
source
${
MAIN_ROOT
}
/utils/parse_options.sh
||
exit
1
;
...
@@ -21,7 +22,7 @@ fi
...
@@ -21,7 +22,7 @@ fi
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
# train model, all `ckpt` under `exp` dir
# train model, all `ckpt` under `exp` dir
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
${
ips
}
fi
fi
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
...
...
examples/tiny/asr1/local/train.sh
浏览文件 @
1628e19b
...
@@ -17,13 +17,20 @@ if [ ${seed} != 0 ]; then
...
@@ -17,13 +17,20 @@ if [ ${seed} != 0 ]; then
echo
"using seed
$seed
& FLAGS_cudnn_deterministic=True ..."
echo
"using seed
$seed
& FLAGS_cudnn_deterministic=True ..."
fi
fi
if
[
$#
!=
2
]
;
then
if
[
$#
-lt
2
]
&&
[
$#
-gt
3
]
;
then
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name"
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name
ips(optional)
"
exit
-1
exit
-1
fi
fi
config_path
=
$1
config_path
=
$1
ckpt_name
=
$2
ckpt_name
=
$2
ips
=
$3
if
[
!
$ips
]
;
then
ips_config
=
else
ips_config
=
"--ips="
${
ips
}
fi
mkdir
-p
exp
mkdir
-p
exp
...
@@ -37,7 +44,7 @@ python3 -u ${BIN_DIR}/train.py \
...
@@ -37,7 +44,7 @@ python3 -u ${BIN_DIR}/train.py \
--benchmark-batch-size
${
benchmark_batch_size
}
\
--benchmark-batch-size
${
benchmark_batch_size
}
\
--benchmark-max-step
${
benchmark_max_step
}
--benchmark-max-step
${
benchmark_max_step
}
else
else
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
BIN_DIR
}
/train.py
\
python3
-m
paddle.distributed.launch
--gpus
=
${
CUDA_VISIBLE_DEVICES
}
${
ips_config
}
${
BIN_DIR
}
/train.py
\
--ngpu
${
ngpu
}
\
--ngpu
${
ngpu
}
\
--seed
${
seed
}
\
--seed
${
seed
}
\
--config
${
config_path
}
\
--config
${
config_path
}
\
...
...
examples/tiny/asr1/run.sh
浏览文件 @
1628e19b
...
@@ -2,10 +2,11 @@
...
@@ -2,10 +2,11 @@
set
-e
set
-e
source
path.sh
source
path.sh
gpus
=
0
gpus
=
4
stage
=
0
stage
=
0
stop_stage
=
50
stop_stage
=
50
conf_path
=
conf/transformer.yaml
conf_path
=
conf/transformer.yaml
ips
=
#xx.xx.xx.xx,xx.xx.xx.xx
decode_conf_path
=
conf/tuning/decode.yaml
decode_conf_path
=
conf/tuning/decode.yaml
avg_num
=
1
avg_num
=
1
...
@@ -22,7 +23,7 @@ fi
...
@@ -22,7 +23,7 @@ fi
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
# train model, all `ckpt` under `exp` dir
# train model, all `ckpt` under `exp` dir
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
${
ips
}
fi
fi
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
...
...
paddlespeech/cli/asr/infer.py
浏览文件 @
1628e19b
...
@@ -136,7 +136,6 @@ class ASRExecutor(BaseExecutor):
...
@@ -136,7 +136,6 @@ class ASRExecutor(BaseExecutor):
logger
.
info
(
"start to init the model"
)
logger
.
info
(
"start to init the model"
)
# default max_len: unit:second
# default max_len: unit:second
self
.
max_len
=
50
self
.
max_len
=
50
assert
num_decoding_left_chunks
==
-
1
or
num_decoding_left_chunks
>=
0
if
hasattr
(
self
,
'model'
):
if
hasattr
(
self
,
'model'
):
logger
.
info
(
'Model had been initialized.'
)
logger
.
info
(
'Model had been initialized.'
)
return
return
...
@@ -187,6 +186,8 @@ class ASRExecutor(BaseExecutor):
...
@@ -187,6 +186,8 @@ class ASRExecutor(BaseExecutor):
elif
"conformer"
in
model_type
or
"transformer"
in
model_type
:
elif
"conformer"
in
model_type
or
"transformer"
in
model_type
:
self
.
config
.
decode
.
decoding_method
=
decode_method
self
.
config
.
decode
.
decoding_method
=
decode_method
if
num_decoding_left_chunks
:
assert
num_decoding_left_chunks
==
-
1
or
num_decoding_left_chunks
>=
0
,
f
"num_decoding_left_chunks should be -1 or >=0"
self
.
config
.
num_decoding_left_chunks
=
num_decoding_left_chunks
self
.
config
.
num_decoding_left_chunks
=
num_decoding_left_chunks
else
:
else
:
...
...
paddlespeech/resource/pretrained_models.py
浏览文件 @
1628e19b
...
@@ -136,9 +136,9 @@ asr_dynamic_pretrained_models = {
...
@@ -136,9 +136,9 @@ asr_dynamic_pretrained_models = {
"deepspeech2online_wenetspeech-zh-16k"
:
{
"deepspeech2online_wenetspeech-zh-16k"
:
{
'1.0'
:
{
'1.0'
:
{
'url'
:
'url'
:
'https://paddlespeech.bj.bcebos.com/s2t/wenetspeech/asr0/asr0_deepspeech2_online_wenetspeech_ckpt_1.0.
1
.model.tar.gz'
,
'https://paddlespeech.bj.bcebos.com/s2t/wenetspeech/asr0/asr0_deepspeech2_online_wenetspeech_ckpt_1.0.
2
.model.tar.gz'
,
'md5'
:
'md5'
:
'
d1be86a3e786042ab64f05161b5fae62
'
,
'
b0c77e7f8881e0a27b82127d1abb8d5f
'
,
'cfg_path'
:
'cfg_path'
:
'model.yaml'
,
'model.yaml'
,
'ckpt_path'
:
'ckpt_path'
:
...
...
paddlespeech/server/engine/asr/online/asr_engine.py
浏览文件 @
1628e19b
...
@@ -793,8 +793,9 @@ class ASRServerExecutor(ASRExecutor):
...
@@ -793,8 +793,9 @@ class ASRServerExecutor(ASRExecutor):
self
.
config
.
decode
.
decoding_method
=
decode_method
self
.
config
.
decode
.
decoding_method
=
decode_method
# update num_decoding_left_chunks
# update num_decoding_left_chunks
if
num_decoding_left_chunks
:
if
num_decoding_left_chunks
:
assert
num_decoding_left_chunks
==
-
1
or
num_decoding_left_chunks
>=
0
,
f
"num_decoding_left_chunks should be -1 or >=0"
self
.
config
.
decode
.
num_decoding_left_chunks
=
num_decoding_left_chunks
self
.
config
.
decode
.
num_decoding_left_chunks
=
num_decoding_left_chunks
assert
self
.
config
.
decode
.
num_decoding_left_chunks
==
-
1
or
self
.
config
.
decode
.
num_decoding_left_chunks
>=
0
,
"num_decoding_left_chunks should be -1 or >=0"
# we only support ctc_prefix_beam_search and attention_rescoring dedoding method
# we only support ctc_prefix_beam_search and attention_rescoring dedoding method
# Generally we set the decoding_method to attention_rescoring
# Generally we set the decoding_method to attention_rescoring
if
self
.
config
.
decode
.
decoding_method
not
in
[
if
self
.
config
.
decode
.
decoding_method
not
in
[
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录