diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9c8c9c4f727866d006c3374d629e7881e94d7d84..c9d3481438d2dcf62ee5efe122373c4c2b69bb32 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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)
 --------------------
 
diff --git a/app/openai_whisper/core.py b/app/openai_whisper/core.py
index 88bde4f2b20f8a91887d5dbdc7ca049cc58d39d9..e93f5ff3d05ead22704e7aeec3cb9435dc25ddad 100644
--- a/app/openai_whisper/core.py
+++ b/app/openai_whisper/core.py
@@ -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: