]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
whisper : use correct seek_end when offset is used (#833)
authorThijs Raymakers <redacted>
Sat, 29 Apr 2023 15:55:37 +0000 (17:55 +0200)
committerGitHub <redacted>
Sat, 29 Apr 2023 15:55:37 +0000 (18:55 +0300)
commit6108d3cc580e6ca80ee265c6fcc306e29dc62645
tree3e770fe7d8d192303fc7a7f4d26b5136608ac78e
parentbab97c83d0c9f040bfe1be02c047f272c1a43841
whisper : use correct seek_end when offset is used (#833)

Whenever an `offset_ms` is provided, the value of `seek_end` is
calculated incorrectly. This causes Whisper to keep transcribing
after the end of the file.

The current behavior looks like
```
[00:34:40.000 --> 00:34:47.000]   This is an example audio file.
[00:34:47.000 --> 00:34:49.000]   The text has been redacted
[00:34:49.000 --> 00:34:51.000]   This is the end of the audio.
[00:34:51.000 --> 00:34:52.000]   ***
[00:34:52.000 --> 00:34:53.000]   ***
[00:34:53.000 --> 00:34:54.000]   ***
[00:34:55.000 --> 00:34:56.000]   ***
...
```

The expected behavior should be
```
[00:34:40.000 --> 00:34:47.000]   This is an example audio file.
[00:34:47.000 --> 00:34:49.000]   The text has been redacted
[00:34:49.000 --> 00:34:51.000]   This is the end of the audio.
- end of program -
```

This commit changes the calculation of the `seek_end` variable to
only add `seek_start` if a custom `duration_ms` is provided.
Otherwise, it defaults to the end of the file.

Signed-off-by: Thijs Raymakers <redacted>
whisper.cpp