From fc218079eadca37722be27d712fa38260181b009 Mon Sep 17 00:00:00 2001 From: zhangheng Date: Sat, 3 Feb 2024 15:43:15 +0800 Subject: [PATCH] Update cmd-asr.py slice files order by name --- tools/damo_asr/cmd-asr.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/damo_asr/cmd-asr.py b/tools/damo_asr/cmd-asr.py index 9a10797..9840e91 100644 --- a/tools/damo_asr/cmd-asr.py +++ b/tools/damo_asr/cmd-asr.py @@ -25,7 +25,9 @@ model = AutoModel(model=path_asr, model_revision="v2.0.4", opt=[] -for name in os.listdir(dir): +file_names = os.listdir(dir) +file_names.sort() +for name in file_names: try: text = model.generate(input="%s/%s"%(dir,name))[0]["text"] opt.append("%s/%s|%s|ZH|%s"%(dir,name,opt_name,text))