From 9752f0a03b4553621450298c40907b19d4b9afa1 Mon Sep 17 00:00:00 2001 From: megemini Date: Wed, 18 Dec 2024 14:43:28 +0800 Subject: [PATCH] =?UTF-8?q?[Hackathon=207th]=20=E4=BF=AE=E5=A4=8D=20`asr5`?= =?UTF-8?q?=20=E7=9A=84=20`test.sh`=20=E8=84=9A=E6=9C=AC=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF=20(#3941)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Fix] test parsearg and test.sh * [Update] use short path --- examples/librispeech/asr5/local/test.sh | 6 +++--- paddlespeech/s2t/exps/wavlm/bin/test.py | 5 ++--- paddlespeech/s2t/exps/wavlm/bin/test_wav.py | 4 ---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/examples/librispeech/asr5/local/test.sh b/examples/librispeech/asr5/local/test.sh index 18158bd5..07c0deec 100644 --- a/examples/librispeech/asr5/local/test.sh +++ b/examples/librispeech/asr5/local/test.sh @@ -23,7 +23,7 @@ source ${MAIN_ROOT}/utils/parse_options.sh || exit 1; # exit 1 #fi -python3 format_rsl.py \ +python3 ${MAIN_ROOT}/utils/format_rsl.py \ --origin_ref data/manifest.test-clean.raw \ --trans_ref data/manifest.test-clean.text @@ -44,7 +44,7 @@ for type in ctc_greedy_search; do echo "Failed in evaluation!" exit 1 fi - python3 format_rsl.py \ + python3 ${MAIN_ROOT}/utils/format_rsl.py \ --origin_hyp ${ckpt_prefix}.${type}.rsl \ --trans_hyp ${ckpt_prefix}.${type}.rsl.text @@ -69,7 +69,7 @@ for type in ctc_prefix_beam_search; do echo "Failed in evaluation!" exit 1 fi - python3 format_rsl.py \ + python3 ${MAIN_ROOT}/utils/format_rsl.py \ --origin_hyp ${ckpt_prefix}.${type}.rsl \ --trans_hyp ${ckpt_prefix}.${type}.rsl.text diff --git a/paddlespeech/s2t/exps/wavlm/bin/test.py b/paddlespeech/s2t/exps/wavlm/bin/test.py index f56b418b..b84421b5 100644 --- a/paddlespeech/s2t/exps/wavlm/bin/test.py +++ b/paddlespeech/s2t/exps/wavlm/bin/test.py @@ -18,7 +18,8 @@ from yacs.config import CfgNode from paddlespeech.s2t.exps.wavlm.model import WavLMASRTester as Tester from paddlespeech.s2t.training.cli import default_argument_parser -from paddlespeech.utils.argparse import print_arguments, add_arguments +from paddlespeech.utils.argparse import add_arguments +from paddlespeech.utils.argparse import print_arguments def main_sp(config, args): @@ -37,8 +38,6 @@ if __name__ == "__main__": # save asr result to parser.add_argument( '--dict-path', type=str, default=None, help='dict path.') - parser.add_argument( - "--result_file", type=str, help="path of save the asr result") args = parser.parse_args() print_arguments(args, globals()) diff --git a/paddlespeech/s2t/exps/wavlm/bin/test_wav.py b/paddlespeech/s2t/exps/wavlm/bin/test_wav.py index e6c07629..2f4728b0 100644 --- a/paddlespeech/s2t/exps/wavlm/bin/test_wav.py +++ b/paddlespeech/s2t/exps/wavlm/bin/test_wav.py @@ -105,10 +105,6 @@ def main(config, args): if __name__ == "__main__": parser = default_argument_parser() # save asr result to - parser.add_argument( - "--result_file", type=str, help="path of save the asr result") - parser.add_argument( - "--audio_file", type=str, help="path of the input audio file") args = parser.parse_args() config = CfgNode(new_allowed=True)