mirror of
https://github.com/mudler/LocalAI.git
synced 2026-05-19 14:17:21 -04:00
feat(whisper): register set_abort symbol in the purego loader
Adds the Go-side binding for the new C export so the next commit can call CppSetAbort(1) from a watcher goroutine on ctx.Done(). Assisted-by: Claude:claude-haiku-4-5 Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
@@ -25,6 +25,7 @@ var (
|
||||
CppNTokens func(i int) int
|
||||
CppGetTokenID func(i int, j int) int
|
||||
CppGetSegmentSpeakerTurnNext func(i int) bool
|
||||
CppSetAbort func(v int)
|
||||
)
|
||||
|
||||
type Whisper struct {
|
||||
|
||||
@@ -41,6 +41,7 @@ func main() {
|
||||
{&CppNTokens, "n_tokens"},
|
||||
{&CppGetTokenID, "get_token_id"},
|
||||
{&CppGetSegmentSpeakerTurnNext, "get_segment_speaker_turn_next"},
|
||||
{&CppSetAbort, "set_abort"},
|
||||
}
|
||||
|
||||
for _, lf := range libFuncs {
|
||||
|
||||
Reference in New Issue
Block a user