From f1f78bdcc289e2696c7962dd80cf0aad53ce3f57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=82=A6?= Date: Sat, 23 Mar 2024 10:28:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9Faster-Whisper=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E9=BB=98=E8=AE=A4=E4=B8=8B=E8=BD=BDC=E7=9B=98?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当前的版本在Windows下测试,如果whisper模型不存在,会在C:\Users\用户名\.cache\huggingface\hub下载模型,占用C盘空间 --- tools/asr/fasterwhisper_asr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/asr/fasterwhisper_asr.py b/tools/asr/fasterwhisper_asr.py index f7b31aab..536cf3ff 100644 --- a/tools/asr/fasterwhisper_asr.py +++ b/tools/asr/fasterwhisper_asr.py @@ -47,7 +47,7 @@ def execute_asr(input_folder, output_folder, model_size, language,precision): print("loading faster whisper model:",model_size,model_path) device = 'cuda' if torch.cuda.is_available() else 'cpu' try: - model = WhisperModel(model_path, device=device, compute_type=precision) + model = WhisperModel(model_path, device=device, compute_type=precision,download_root="./tools/asr/models",local_files_only=False) except: return print(traceback.format_exc()) output = []