Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added local_files_only option on whisperx.load_model for offline mode #867

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions whisperx/asr.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ def load_model(whisper_arch,
model : Optional[WhisperModel] = None,
task="transcribe",
download_root=None,
local_files_only=False,
threads=4):
'''Load a Whisper model for inference.
Args:
Expand All @@ -277,6 +278,7 @@ def load_model(whisper_arch,
language: str - The language of the model. (use English for now)
model: Optional[WhisperModel] - The WhisperModel instance to use.
download_root: Optional[str] - The root directory to download the model to.
local_files_only: Optional[bool] - If `True`, avoid downloading the file and return the path to the local cached file if it exists.
threads: int - The number of cpu threads to use per worker, e.g. will be multiplied by num workers.
Returns:
A Whisper pipeline.
Expand All @@ -290,6 +292,7 @@ def load_model(whisper_arch,
device_index=device_index,
compute_type=compute_type,
download_root=download_root,
local_files_only=local_files_only,
cpu_threads=threads)
if language is not None:
tokenizer = faster_whisper.tokenizer.Tokenizer(model.hf_tokenizer, model.model.is_multilingual, task=task, language=language)
Expand Down