From 5a7616bcbb58cfa518d2fbde48fd40ffdf04377a Mon Sep 17 00:00:00 2001 From: azhuge233 <17763056+azhuge233@users.noreply.github.com> Date: Tue, 28 Nov 2023 11:09:55 +0800 Subject: [PATCH] Fix compatability issue with Whisper.NET 1.5.0 --- ConsoleWhisper/Model/Argument.cs | 8 ++++---- ConsoleWhisper/Module/WhisperHelper.cs | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ConsoleWhisper/Model/Argument.cs b/ConsoleWhisper/Model/Argument.cs index a3e0f64..f9b994a 100644 --- a/ConsoleWhisper/Model/Argument.cs +++ b/ConsoleWhisper/Model/Argument.cs @@ -8,7 +8,7 @@ public class Argument { [Value(5)] public IEnumerable Files { get; set; } - [Option('m', "model", Required = false, Hidden = false, Default = "small", HelpText = "Whisper model: base, tiny, small, medium, large.")] + [Option('m', "model", Required = false, Hidden = false, Default = "small", HelpText = "Whisper model: base, tiny, small, medium, large-v1, large-v2, large-v3.")] [Value(0, Min = 0, Max = 1, Required = false)] public string ModelType { get; set; } @@ -45,13 +45,13 @@ public class Argument { internal const int SupportedArgumentsCount = 8; - private static readonly HashSet SupportedModels = new() { "base", "tiny", "small", "medium", "large" }; - private static readonly HashSet SupportedLanguages = new() { "en", "zh", "de", "es", "ru", "ko", "fr", "ja", "pt", "tr", + private static readonly HashSet SupportedModels = [ "base", "tiny", "small", "medium", "large-v1", "large-v2", "large-v3" ]; + private static readonly HashSet SupportedLanguages = [ "en", "zh", "de", "es", "ru", "ko", "fr", "ja", "pt", "tr", "pl", "ca", "nl", "ar", "sv", "it", "id", "hi", "fi", "vi", "he", "uk", "el", "ms", "ro", "da", "hu", "ta", "no", "th", "ur", "hr", "bg", "lt", "la", "mi", "ml", "cy", "sk", "te", "fa", "lv", "bn", "sr", "az", "sl", "kn", "et", "mk", "br", "eu", "is", "hy", "ne", "mn", "bs", "kk", "sq", "sw", "gl", "mr", "pa", "si", "km", "sn", "yo", "so", "af", "oc", "ka", "be", "tg", "sd", "gu", "am", "yi", "lo", "uz", "fo", "ht", "ps", "tk", "nn", "mt", "sa", "lb", "my", "bo", "tl", "mg", "as", "tt", "haw", "ln", - "ha", "ba", "jw", "su", "auto" }; + "ha", "ba", "jw", "su", "auto" ]; private const string LanguageLink = "https://github.com/ggerganov/whisper.cpp/blob/57543c169e27312e7546d07ed0d8c6eb806ebc36/whisper.cpp#L121"; } diff --git a/ConsoleWhisper/Module/WhisperHelper.cs b/ConsoleWhisper/Module/WhisperHelper.cs index 65fdf88..36cb6b1 100644 --- a/ConsoleWhisper/Module/WhisperHelper.cs +++ b/ConsoleWhisper/Module/WhisperHelper.cs @@ -46,7 +46,8 @@ internal class WhisperHelper { private static readonly Dictionary ModelTypeMap = new() { { "ggml-base.bin", GgmlType.Base }, { "ggml-tiny.bin", GgmlType.Tiny }, { "ggml-small.bin", GgmlType.Small }, - { "ggml-medium.bin", GgmlType.Medium }, { "ggml-large.bin", GgmlType.Large } + { "ggml-medium.bin", GgmlType.Medium }, { "ggml-large-v1.bin", GgmlType.LargeV1 }, { "ggml-large-v2.bin", GgmlType.LargeV2 }, + { "ggml-large-v3.bin", GgmlType.LargeV3 } }; } }