mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2024-12-18 20:27:53 +00:00
Adding in a way to retrieve the detected language for golang bindings
Adding in a function, GetDetectedLanguage, which will retrieve the detected language, if available.
This commit is contained in:
parent
cdce0ff157
commit
8d60666cbc
@ -289,6 +289,10 @@ func (context *context) IsLANG(t Token, lang string) bool {
|
||||
}
|
||||
}
|
||||
|
||||
func (context *context) GetDetectedLanguage() string {
|
||||
return whisper.Whisper_lang_str(context.model.ctx.Whisper_full_lang_id())
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// PRIVATE METHODS
|
||||
|
||||
|
@ -41,6 +41,8 @@ type Context interface {
|
||||
SetTranslate(bool) // Set translate flag
|
||||
IsMultilingual() bool // Return true if the model is multilingual.
|
||||
Language() string // Get language
|
||||
GetDetectedLanguage() string // Get auto detected language
|
||||
|
||||
|
||||
SetOffset(time.Duration) // Set offset
|
||||
SetDuration(time.Duration) // Set duration
|
||||
|
Loading…
Reference in New Issue
Block a user