Skip to content

Commit

Permalink
Fix compatability issue with Whisper.NET 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
azhuge233 committed Nov 28, 2023
1 parent 70ea784 commit 5a7616b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions ConsoleWhisper/Model/Argument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class Argument {
[Value(5)]
public IEnumerable<string> 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; }

Expand Down Expand Up @@ -45,13 +45,13 @@ public class Argument {

internal const int SupportedArgumentsCount = 8;

private static readonly HashSet<string> SupportedModels = new() { "base", "tiny", "small", "medium", "large" };
private static readonly HashSet<string> SupportedLanguages = new() { "en", "zh", "de", "es", "ru", "ko", "fr", "ja", "pt", "tr",
private static readonly HashSet<string> SupportedModels = [ "base", "tiny", "small", "medium", "large-v1", "large-v2", "large-v3" ];
private static readonly HashSet<string> 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";
}
Expand Down
3 changes: 2 additions & 1 deletion ConsoleWhisper/Module/WhisperHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ internal class WhisperHelper {

private static readonly Dictionary<string, GgmlType> 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 }
};
}
}

0 comments on commit 5a7616b

Please sign in to comment.