Skip to content
Snippets Groups Projects
Commit 6fd7eeb0 authored by Aidan Crowther's avatar Aidan Crowther
Browse files

Configure openai_whisper model to correctly laod n_dims with larger models

parent 539f5852
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,10 @@ Changelog
Unreleased
----------
### Added
- Set mel generation to adjust n_dims automatically to match the loaded model
[1.6.0] (2024-10-06)
--------------------
......
......@@ -48,7 +48,7 @@ def language_detection(audio):
audio = whisper.pad_or_trim(audio)
# make log-Mel spectrogram and move to the same device as the model
mel = whisper.log_mel_spectrogram(audio).to(model.device)
mel = whisper.log_mel_spectrogram(audio, model.dims.n_mels).to(model.device)
# detect the spoken language
with model_lock:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment