mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2023-11-04 02:52:44 +03:00
go : support "auto" as an option when set language (#462)
Co-authored-by: Ming <ming@localhost>
This commit is contained in:
@@ -49,6 +49,10 @@ func (p *Params) SetSpeedup(v bool) {
|
||||
|
||||
// Set language id
|
||||
func (p *Params) SetLanguage(lang int) error {
|
||||
if lang == -1 {
|
||||
p.language = nil
|
||||
return nil
|
||||
}
|
||||
str := C.whisper_lang_str(C.int(lang))
|
||||
if str == nil {
|
||||
return ErrInvalidLanguage
|
||||
|
||||
Reference in New Issue
Block a user