Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Do not assert for a negative timestamp #1947

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gaspardpetit
Copy link

This may be thrown when verbose is set to True and a very short audio is transcribed, resulting in a negative timestamp. Even though this is not a desired use case, it is preferable to keep going without raising an exception.

This may be thrown when `verbose` is set to True and a very short audio is transcribed, resulting in a negative timestamp. Even though this is not a desired use case, it is preferable to keep going without raising an exception.
linsen20220222 pushed a commit to zebra-media/whisper that referenced this pull request Nov 29, 2024
As of openai#1486, whisper.cpp uses a unified KV cache with KQ masking.
As a result, depending on their location in the batch,
identical sequences in a batch can have slightly different outputs
due to floating point rounding errors during reduction.
See the discussion in openai#1941 for more details.

The beam search code used "has identical sum of log probabilities"
as a shorthand for "is an identical token sequence". However, per above,
identical tokens do not necessarily result in identical probabilities.

Instead, explicitly compare on sequences.
This is linear in cost when they are identical,
but the lengths are always small and the comparisons are cheap.

This increases diversity during beam search.

This improves output quality for some short samples I've been working
with, at no detectable performance cost.
I haven't checked against larger corpuses.

Fixes openai#1941
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant