Update README.md

Demonstrates use of argument to save model to local path.
This commit is contained in:
Tobi John
2023-12-15 13:46:32 +00:00
committed by GitHub
parent 19ab91c5a6
commit 9f23739f90

View File

@ -165,6 +165,10 @@ compute_type = "float16" # change to "int8" if low on GPU mem (may reduce accura
# 1. Transcribe with original whisper (batched)
model = whisperx.load_model("large-v2", device, compute_type=compute_type)
# save model to local path (optional)
# model_dir = "/path/"
# model = whisperx.load_model("large-v2", device, compute_type=compute_type, download_root=model_dir)
audio = whisperx.load_audio(audio_file)
result = model.transcribe(audio, batch_size=batch_size)
print(result["segments"]) # before alignment