Skip to content
Snippets Groups Projects
Unverified Commit 6d074b2e authored by Ahmet Öner's avatar Ahmet Öner Committed by GitHub
Browse files

Merge pull request #259 from aidancrowther/fix-language-detection

Correctly load n_dims for openai_whisper model
parents 539f5852 6fd7eeb0
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