Feat/accept cmd args (#2)

* make working dir as executable dir

* Add support for cli args
This commit is contained in:
Łukasz Kwiecień
2024-03-14 21:06:34 +01:00
committed by xzeldon
parent 1f8912eb6d
commit 0a281f79d6
5 changed files with 180 additions and 13 deletions

View File

@ -15,7 +15,7 @@ type WhisperState struct {
mutex sync.Mutex
}
func InitializeWhisperState(modelPath string) (*WhisperState, error) {
func InitializeWhisperState(modelPath string, lang int32) (*WhisperState, error) {
lib, err := whisper.New(whisper.LlDebug, whisper.LfUseStandardError, nil)
if err != nil {
return nil, err
@ -41,6 +41,8 @@ func InitializeWhisperState(modelPath string) (*WhisperState, error) {
return nil, err
}
params.SetLanguage(lang)
fmt.Printf("Params CPU Threads : %d\n", params.CpuThreads())
return &WhisperState{