From e62dfbf1afebabfd602406ce62d1c8961c7b0eff Mon Sep 17 00:00:00 2001 From: makaveli10 Date: Mon, 22 May 2023 16:17:09 +0800 Subject: [PATCH] use local files for huggingface ,odel --- transcriber.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/transcriber.py b/transcriber.py index 834ffb5..e4404e3 100644 --- a/transcriber.py +++ b/transcriber.py @@ -82,6 +82,7 @@ class WhisperModel: cpu_threads: int = 0, num_workers: int = 1, download_root: Optional[str] = None, + local_files_only: bool = True, ): """Initializes the Whisper model. @@ -111,7 +112,11 @@ class WhisperModel: if os.path.isdir(model_size_or_path): model_path = model_size_or_path else: - model_path = download_model(model_size_or_path, download_root) + model_path = download_model( + model_size_or_path, + local_files_only=local_files_only, + cache_dir=download_root, + ) self.model = ctranslate2.models.Whisper( model_path,