diff --git a/src/ui/Forms/AudioToText/WhisperAudioToText.cs b/src/ui/Forms/AudioToText/WhisperAudioToText.cs index 24fabe97b..241e7c161 100644 --- a/src/ui/Forms/AudioToText/WhisperAudioToText.cs +++ b/src/ui/Forms/AudioToText/WhisperAudioToText.cs @@ -397,6 +397,18 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText } } + if (comboBoxModels.Items[comboBoxModels.SelectedIndex] is WhisperModel model2 && + _languageCode != "no" && _languageCode != "nb" && IsModelNorwegianOnly(model2)) + { + var result = MessageBox.Show("Norwegian model should only be used with Norwegian language." + Environment.NewLine + + "Continue anyway?", Text, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning); + if (result != DialogResult.Yes) + { + return; + } + } + + try { var f = SeLogger.GetWhisperLogFilePath(); @@ -521,6 +533,11 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText model.Name == "distil-large-v3"; } + private static bool IsModelNorwegianOnly(WhisperModel model) + { + return model.ToString().Contains("Norwegian", StringComparison.OrdinalIgnoreCase); + } + private void ShowProgressBar() { progressBar1.Maximum = 100;