go : added wrappers to reset and print timings (#436)

This commit is contained in:
Lukas Rist
2023-01-25 17:57:30 +01:00
committed by GitHub
parent 411ea9b833
commit 02c7516c57
4 changed files with 17 additions and 0 deletions

View File

@@ -107,6 +107,16 @@ func (context *context) SetMaxTokensPerSegment(n uint) {
context.params.SetMaxTokensPerSegment(int(n))
}
// ResetTimings resets the mode timings. Should be called before processing
func (context *context) ResetTimings() {
context.model.ctx.Whisper_reset_timings()
}
// PrintTimings prints the model timings to stdout.
func (context *context) PrintTimings() {
context.model.ctx.Whisper_print_timings()
}
// Process new sample data and return any errors
func (context *context) Process(data []float32, cb SegmentCallback) error {
if context.model.ctx == nil {