提交 1e999c27 编写于 作者: H huangyuxin

fix exit, test=doc

上级 25cb4d62
...@@ -346,7 +346,7 @@ class ASRExecutor(BaseExecutor): ...@@ -346,7 +346,7 @@ class ASRExecutor(BaseExecutor):
max_duration = 50.0 max_duration = 50.0
if audio_duration >= max_duration: if audio_duration >= max_duration:
logger.error("Please input audio file less then 50 seconds.\n") logger.error("Please input audio file less then 50 seconds.\n")
exit(1) return False
except Exception as e: except Exception as e:
logger.exception(e) logger.exception(e)
logger.error( logger.error(
...@@ -383,7 +383,7 @@ class ASRExecutor(BaseExecutor): ...@@ -383,7 +383,7 @@ class ASRExecutor(BaseExecutor):
) == "n" or content.strip() == "no" or content.strip( ) == "n" or content.strip() == "no" or content.strip(
) == "No": ) == "No":
logger.info("Exit the program") logger.info("Exit the program")
exit(1) return False
else: else:
logger.warning("Not regular input, please input again") logger.warning("Not regular input, please input again")
......
...@@ -22,7 +22,7 @@ paddlespeech asr --model deepspeech2offline_librispeech --lang en --input ./en.w ...@@ -22,7 +22,7 @@ paddlespeech asr --model deepspeech2offline_librispeech --lang en --input ./en.w
# long audio restriction # long audio restriction
wget -c wget https://paddlespeech.bj.bcebos.com/datasets/single_wav/zh/test_long_audio_01.wav 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 paddlespeech asr --input test_long_audio_01.wav
if [ $? -ne 1 ]; then if [ $? -ne -1 ]; then
exit 1 exit 1
fi fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册