From cea5728dd7c0be96578a13eb8ea3ddbe7665fc25 Mon Sep 17 00:00:00 2001 From: huangyuxin Date: Fri, 25 Feb 2022 08:01:15 +0000 Subject: [PATCH] fix unit test --- tests/unit/asr/deepspeech2_online_model_test.py | 3 ++- tests/unit/asr/deepspeech2_online_model_test.sh | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 tests/unit/asr/deepspeech2_online_model_test.sh diff --git a/tests/unit/asr/deepspeech2_online_model_test.py b/tests/unit/asr/deepspeech2_online_model_test.py index 3d634945..d26e5b15 100644 --- a/tests/unit/asr/deepspeech2_online_model_test.py +++ b/tests/unit/asr/deepspeech2_online_model_test.py @@ -191,7 +191,8 @@ class TestDeepSpeech2StaticModelOnline(unittest.TestCase): def setUp(self): export_prefix = "exp/deepspeech2_online/checkpoints/test_export" - os.makedirs( os.path.dirname(export_prefix), mode=0o755) + if not os.path.exists(os.path.dirname(export_prefix)): + os.makedirs(os.path.dirname(export_prefix), mode=0o755) infer_model = DeepSpeech2InferModelOnline( feat_size=161, dict_size=4233, diff --git a/tests/unit/asr/deepspeech2_online_model_test.sh b/tests/unit/asr/deepspeech2_online_model_test.sh new file mode 100644 index 00000000..cd5a2d3a --- /dev/null +++ b/tests/unit/asr/deepspeech2_online_model_test.sh @@ -0,0 +1,3 @@ +mkdir -p test_data +wget -P test_data https://paddlespeech.bj.bcebos.com/datasets/unit_test/asr/static_ds2online_inputs.pickle +python deepspeech2_online_model_test.py -- GitLab