Merge pull request #1770 from Jackwaterveg/cli

[ASR] fix asr cli infer
pull/1779/head
Hui Zhang 3 years ago committed by GitHub
commit f11855415c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -346,7 +346,7 @@ class ASRExecutor(BaseExecutor):
max_duration = 50.0
if audio_duration >= max_duration:
logger.error("Please input audio file less then 50 seconds.\n")
return
return False
except Exception as e:
logger.exception(e)
logger.error(
@ -383,7 +383,7 @@ class ASRExecutor(BaseExecutor):
) == "n" or content.strip() == "no" or content.strip(
) == "No":
logger.info("Exit the program")
exit(1)
return False
else:
logger.warning("Not regular input, please input again")

@ -12,12 +12,17 @@ paddlespeech text --input 今天的天气真不错啊你下午有空吗我想约
# Speech_recognition
wget -c https://paddlespeech.bj.bcebos.com/PaddleAudio/zh.wav https://paddlespeech.bj.bcebos.com/PaddleAudio/en.wav
paddlespeech asr --input ./zh.wav
paddlespeech asr --model conformer_aishell --input ./zh.wav
paddlespeech asr --model conformer_online_aishell --input ./zh.wav
paddlespeech asr --model transformer_librispeech --lang en --input ./en.wav
paddlespeech asr --model deepspeech2offline_aishell --input ./zh.wav
paddlespeech asr --model deepspeech2online_aishell --input ./zh.wav
paddlespeech asr --model deepspeech2offline_librispeech --lang en --input ./en.wav
# long audio restriction
wget -c wget https://paddlespeech.bj.bcebos.com/datasets/single_wav/zh/test_long_audio_01.wav
paddlespeech asr --input test_long_audio_01.wav
if [ $? -ne 1 ]; then
if [ $? -ne -1 ]; then
exit 1
fi

Loading…
Cancel
Save