From 65d754965e2cf3f9e92831fb68f844f9c27b33cf Mon Sep 17 00:00:00 2001 From: XXXXRT666 <157766680+XXXXRT666@users.noreply.github.com> Date: Mon, 1 Jul 2024 23:14:13 +0800 Subject: [PATCH] DS_STORE (#1267) --- tools/asr/fasterwhisper_asr.py | 2 +- tools/cmd-denoise.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/asr/fasterwhisper_asr.py b/tools/asr/fasterwhisper_asr.py index 669ac3a..e9fc6a4 100644 --- a/tools/asr/fasterwhisper_asr.py +++ b/tools/asr/fasterwhisper_asr.py @@ -78,7 +78,7 @@ def execute_asr(input_folder, output_folder, model_size, language, precision): text += segment.text output.append(f"{file_path}|{output_file_name}|{info.language.upper()}|{text}") except: - return print(traceback.format_exc()) + print(traceback.format_exc()) output_folder = output_folder or "output/asr_opt" os.makedirs(output_folder, exist_ok=True) diff --git a/tools/cmd-denoise.py b/tools/cmd-denoise.py index 69b51e6..d8d1d2f 100644 --- a/tools/cmd-denoise.py +++ b/tools/cmd-denoise.py @@ -1,5 +1,5 @@ import os,argparse - +import traceback from modelscope.pipelines import pipeline from modelscope.utils.constant import Tasks from tqdm import tqdm @@ -12,7 +12,10 @@ def execute_denoise(input_folder,output_folder): # print(input_folder) # print(list(os.listdir(input_folder).sort())) for name in tqdm(os.listdir(input_folder)): - ans("%s/%s"%(input_folder,name),output_path='%s/%s'%(output_folder,name)) + try: + ans("%s/%s"%(input_folder,name),output_path='%s/%s'%(output_folder,name)) + except: + traceback.print_exc() if __name__ == '__main__': parser = argparse.ArgumentParser()