fix exit, test=doc

pull/1770/head
huangyuxin 4 years ago
parent 25cb4d62ac
commit 1e999c27e9

@ -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")
exit(1)
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")

@ -22,7 +22,7 @@ paddlespeech asr --model deepspeech2offline_librispeech --lang en --input ./en.w
# 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