You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PaddleSpeech/speechx/examples/decoder/run.sh

44 lines
1.0 KiB

3 years ago
#!/bin/bash
set +x
set -e
3 years ago
. path.sh
3 years ago
# 1. compile
3 years ago
if [ ! -d ${SPEECHX_EXAMPLES} ]; then
pushd ${SPEECHX_ROOT}
3 years ago
bash build.sh
3 years ago
popd
3 years ago
fi
3 years ago
3 years ago
# 2. download model
if [ ! -d ../paddle_asr_model ]; then
3 years ago
wget -c https://paddlespeech.bj.bcebos.com/s2t/paddle_asr_online/paddle_asr_model.tar.gz
3 years ago
tar xzfv paddle_asr_model.tar.gz
mv ./paddle_asr_model ../
# produce wav scp
echo "utt1 " $PWD/../paddle_asr_model/BAC009S0764W0290.wav > ../paddle_asr_model/wav.scp
fi
model_dir=../paddle_asr_model
feat_wspecifier=./feats.ark
cmvn=./cmvn.ark
3 years ago
export GLOG_logtostderr=1
3 years ago
# 3. gen linear feat
3 years ago
linear_spectrogram_main \
--wav_rspecifier=scp:$model_dir/wav.scp \
--feature_wspecifier=ark,t:$feat_wspecifier \
--cmvn_write_path=$cmvn
3 years ago
# 4. run decoder
3 years ago
offline_decoder_main \
--feature_respecifier=ark:$feat_wspecifier \
--model_path=$model_dir/avg_1.jit.pdmodel \
--param_path=$model_dir/avg_1.jit.pdparams \
--dict_file=$model_dir/vocab.txt \
3 years ago
--lm_path=$model_dir/avg_1.jit.klm