feat: models test and fixes
This commit is contained in:
@@ -17,16 +17,20 @@ func (p *WhisperCppProvider) ValidateAPIKey(key string) bool {
|
||||
return true // no API key needed
|
||||
}
|
||||
|
||||
func (p *WhisperCppProvider) APIKeyURL() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (p *WhisperCppProvider) IsLocal() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (p *WhisperCppProvider) Models() []Model {
|
||||
// https://github.com/openai/whisper#available-models-and-languages
|
||||
// https://github.com/ggml-org/whisper.cpp#models
|
||||
allLangs := whisperTranscriptionLanguages
|
||||
// https://github.com/openai/whisper#available-models-and-languages
|
||||
// https://github.com/ggml-org/whisper.cpp#models
|
||||
englishOnly := whisperEnglishOnlyLanguages
|
||||
docsURL := "https://github.com/openai/whisper#available-models-and-languages"
|
||||
docsURL := "https://github.com/ggml-org/whisper.cpp#models"
|
||||
|
||||
whisperModels := whisper.ListModels()
|
||||
result := make([]Model, 0, len(whisperModels))
|
||||
@@ -63,10 +67,36 @@ func (p *WhisperCppProvider) Models() []Model {
|
||||
}
|
||||
|
||||
func modelDescription(m whisper.ModelInfo) string {
|
||||
if m.Multilingual {
|
||||
return "Multilingual local transcription"
|
||||
switch m.ID {
|
||||
case "tiny.en":
|
||||
return "Free/offline; fastest but low accuracy, good for weak hardware"
|
||||
case "base.en":
|
||||
return "Free/offline; balanced speed and accuracy, recommended start"
|
||||
case "small.en":
|
||||
return "Free/offline; better accuracy, needs decent CPU"
|
||||
case "medium.en":
|
||||
return "Free/offline; best .en accuracy, needs good CPU/RAM"
|
||||
case "tiny":
|
||||
return "Free/offline multilingual; fastest but low accuracy"
|
||||
case "base":
|
||||
return "Free/offline multilingual; balanced, recommended start"
|
||||
case "small":
|
||||
return "Free/offline multilingual; better accuracy, needs decent CPU"
|
||||
case "medium":
|
||||
return "Free/offline multilingual; great accuracy, needs good CPU/RAM"
|
||||
case "large-v1":
|
||||
return "Free/offline; high accuracy, needs strong CPU/GPU"
|
||||
case "large-v2":
|
||||
return "Free/offline; high accuracy, needs strong CPU/GPU"
|
||||
case "large-v3":
|
||||
return "Free/offline; best accuracy available, needs strong hardware"
|
||||
case "large-v3-turbo":
|
||||
return "Free/offline; near-best accuracy with better speed"
|
||||
}
|
||||
return "English-only local transcription (faster)"
|
||||
if m.Multilingual {
|
||||
return "Free/offline multilingual model"
|
||||
}
|
||||
return "Free/offline English model"
|
||||
}
|
||||
|
||||
func (p *WhisperCppProvider) DefaultModel(t ModelType) string {
|
||||
|
||||
Reference in New Issue
Block a user