]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
go : implement SetSplitOnWord (#1114)
authorxdrudis <redacted>
Tue, 25 Jul 2023 16:10:12 +0000 (09:10 -0700)
committerGitHub <redacted>
Tue, 25 Jul 2023 16:10:12 +0000 (19:10 +0300)
* Go binding: Implement SetSplitOnWord

* Add comment for consistency

bindings/go/params.go
bindings/go/pkg/whisper/context.go
bindings/go/pkg/whisper/interface.go

index 1ddcbeaa3dd82294e2653eb311fe545c9e8419d6..b480ccf84e5885215c27eabd1aefadd77f2a77b9 100644 (file)
@@ -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)
 }
index 0db277052483d34036caf9699be792ca002c3a0a..6f3c2c747a0d4b257a5583690ebbb7875b0f415d 100644 (file)
@@ -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))
index dc9c66df9c3e042f90dee9cecd26094083807c68..771961abf5b846566960bc9635be05cbc1a4f801 100644 (file)
@@ -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