|
|
|
@ -59,22 +59,16 @@ fi
|
|
|
|
|
if [ ${stage} -le 7 ] && [ ${stop_stage} -ge 7 ]; then
|
|
|
|
|
# install paddle2onnx
|
|
|
|
|
version=$(echo `pip list |grep "paddle2onnx"` |awk -F" " '{print $2}')
|
|
|
|
|
if [[ -z "$version" || ${version} != '0.9.4' ]]; then
|
|
|
|
|
pip install paddle2onnx==0.9.4
|
|
|
|
|
if [[ -z "$version" || ${version} != '0.9.5' ]]; then
|
|
|
|
|
pip install paddle2onnx==0.9.5
|
|
|
|
|
fi
|
|
|
|
|
./local/paddle2onnx.sh ${train_output_path} inference inference_onnx fastspeech2_csmsc
|
|
|
|
|
./local/paddle2onnx.sh ${train_output_path} inference inference_onnx hifigan_csmsc
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# onnxruntime non streaming
|
|
|
|
|
# inference with onnxruntime, use fastspeech2 + hifigan by default
|
|
|
|
|
if [ ${stage} -le 8 ] && [ ${stop_stage} -ge 8 ]; then
|
|
|
|
|
# install onnxruntime
|
|
|
|
|
version=$(echo `pip list |grep "onnxruntime"` |awk -F" " '{print $2}')
|
|
|
|
|
if [[ -z "$version" || ${version} != '1.10.0' ]]; then
|
|
|
|
|
pip install onnxruntime==1.10.0
|
|
|
|
|
fi
|
|
|
|
|
./local/ort_predict.sh ${train_output_path}
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
@ -82,8 +76,8 @@ fi
|
|
|
|
|
if [ ${stage} -le 9 ] && [ ${stop_stage} -ge 9 ]; then
|
|
|
|
|
# install paddle2onnx
|
|
|
|
|
version=$(echo `pip list |grep "paddle2onnx"` |awk -F" " '{print $2}')
|
|
|
|
|
if [[ -z "$version" || ${version} != '0.9.4' ]]; then
|
|
|
|
|
pip install paddle2onnx==0.9.4
|
|
|
|
|
if [[ -z "$version" || ${version} != '0.9.5' ]]; then
|
|
|
|
|
pip install paddle2onnx==0.9.5
|
|
|
|
|
fi
|
|
|
|
|
# streaming acoustic model
|
|
|
|
|
./local/paddle2onnx.sh ${train_output_path} inference_streaming inference_onnx_streaming fastspeech2_csmsc_am_encoder_infer
|
|
|
|
@ -95,11 +89,6 @@ fi
|
|
|
|
|
|
|
|
|
|
# onnxruntime streaming
|
|
|
|
|
if [ ${stage} -le 10 ] && [ ${stop_stage} -ge 10 ]; then
|
|
|
|
|
# install onnxruntime
|
|
|
|
|
version=$(echo `pip list |grep "onnxruntime"` |awk -F" " '{print $2}')
|
|
|
|
|
if [[ -z "$version" || ${version} != '1.10.0' ]]; then
|
|
|
|
|
pip install onnxruntime==1.10.0
|
|
|
|
|
fi
|
|
|
|
|
./local/ort_predict_streaming.sh ${train_output_path}
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|