From a10732c74acd95bf5ed7e2e528babc476ef7daca Mon Sep 17 00:00:00 2001 From: Guillaume Klein Date: Fri, 24 Mar 2023 17:59:11 +0100 Subject: [PATCH] Only download the required model files --- faster_whisper/utils.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/faster_whisper/utils.py b/faster_whisper/utils.py index ee459aa..bfd2f17 100644 --- a/faster_whisper/utils.py +++ b/faster_whisper/utils.py @@ -34,7 +34,18 @@ def download_model( if not show_progress_bars: kwargs["tqdm_class"] = disabled_tqdm - return huggingface_hub.snapshot_download(repo_id, **kwargs) + allow_patterns = [ + "config.json", + "model.bin", + "tokenizer.json", + "vocabulary.txt", + ] + + return huggingface_hub.snapshot_download( + repo_id, + allow_patterns=allow_patterns, + **kwargs, + ) def format_timestamp(