Skip to content

Commit

Permalink
go : implement SetSplitOnWord (openai#1114)
Browse files Browse the repository at this point in the history
* Go binding: Implement SetSplitOnWord

* Add comment for consistency
  • Loading branch information
xdrudis authored Jul 25, 2023
1 parent 1450346 commit a2684cd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bindings/go/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ func (p *Params) SetTranslate(v bool) {
p.translate = toBool(v)
}

func (p *Params) SetSplitOnWord(v bool) {
p.split_on_word = toBool(v)
}

func (p *Params) SetNoContext(v bool) {
p.no_context = toBool(v)
}
Expand Down
4 changes: 4 additions & 0 deletions bindings/go/pkg/whisper/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ func (context *context) SetSpeedup(v bool) {
context.params.SetSpeedup(v)
}

func (context *context) SetSplitOnWord(v bool) {
context.params.SetSplitOnWord(v)
}

// Set number of threads to use
func (context *context) SetThreads(v uint) {
context.params.SetThreads(int(v))
Expand Down
1 change: 1 addition & 0 deletions bindings/go/pkg/whisper/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type Context interface {
SetDuration(time.Duration) // Set duration
SetThreads(uint) // Set number of threads to use
SetSpeedup(bool) // Set speedup flag
SetSplitOnWord(bool) // Set split on word flag
SetTokenThreshold(float32) // Set timestamp token probability threshold
SetTokenSumThreshold(float32) // Set timestamp token sum probability threshold
SetMaxSegmentLength(uint) // Set max segment length in characters
Expand Down

0 comments on commit a2684cd

Please sign in to comment.