m-bain / whisperX

WhisperX: Automatic Speech Recognition with Word-level Timestamps (& Diarization)
BSD 2-Clause "Simplified" License
12.69k stars 1.35k forks source link

whisperx.load_model #767

Open wwfcnu opened 8 months ago

wwfcnu commented 8 months ago

Can whisperx.load_model load locally downloaded models?

GroovyDan commented 8 months ago

Yes just pass the local file path as the whisper_arch argument:

print(">> Loading VAD Model")
vad_model = whisperx.vad.load_vad_model(
    torch.device(DEVICE),
    model_fp=os.path.join(MODEL_DIR, VAD_FOLDER, VAD_FILE),
)
print(">> Loading Whisper Model")
asr_model = whisperx.load_model(
    os.path.join(MODEL_DIR, ASR_FOLDER),
    DEVICE,
    compute_type=COMPUTE_TYPE,
    language="en",
    vad_model=vad_model,
)