|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
source path.sh
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
gpus=0,1,2,3
|
|
|
|
|
stage=0
|
|
|
|
|
stop_stage=100
|
|
|
|
|
conf_path=conf/conformer.yaml
|
|
|
|
@ -22,7 +23,7 @@ fi
|
|
|
|
|
|
|
|
|
|
if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then
|
|
|
|
|
# train model, all `ckpt` under `exp` dir
|
|
|
|
|
CUDA_VISIBLE_DEVICES=0,1,2,3 ./local/train.sh ${conf_path} ${ckpt}
|
|
|
|
|
CUDA_VISIBLE_DEVICES=${gpus} ./local/train.sh ${conf_path} ${ckpt}
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
|
|
|
|
@ -45,13 +46,14 @@ if [ ${stage} -le 5 ] && [ ${stop_stage} -ge 5 ]; then
|
|
|
|
|
CUDA_VISIBLE_DEVICES=0 ./local/export.sh ${conf_path} exp/${ckpt}/checkpoints/${avg_ckpt} exp/${ckpt}/checkpoints/${avg_ckpt}.jit
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Optionally, you can add LM and test it with runtime.
|
|
|
|
|
if [ ${stage} -le 6 ] && [ ${stop_stage} -ge 6 ]; then
|
|
|
|
|
# train lm and build TLG
|
|
|
|
|
./local/tlg.sh --corpus aishell --lmtype srilm
|
|
|
|
|
fi
|
|
|
|
|
# Optionally, you can add LM and test it with runtime.
|
|
|
|
|
if [ ${stage} -le 6 ] && [ ${stop_stage} -ge 6 ]; then
|
|
|
|
|
# test a single .wav file
|
|
|
|
|
CUDA_VISIBLE_DEVICES=0 ./local/test_hub.sh ${conf_path} exp/${ckpt}/checkpoints/${avg_ckpt} ${audio_file} || exit -1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ ${stage} -le 7 ] && [ ${stop_stage} -ge 7 ]; then
|
|
|
|
|
# test a single .wav file
|
|
|
|
|
CUDA_VISIBLE_DEVICES=3 ./local/test_hub.sh ${conf_path} exp/${ckpt}/checkpoints/${avg_ckpt} ${audio_file} || exit -1
|
|
|
|
|
echo "warning: deps on kaldi and srilm, please make sure installed."
|
|
|
|
|
# train lm and build TLG
|
|
|
|
|
./local/tlg.sh --corpus aishell --lmtype srilm
|
|
|
|
|
fi
|
|
|
|
|