mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Add more validation
This commit is contained in:
parent
6f424cc74a
commit
d6f56a0aec
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user