Skip to content

Commit

Permalink
Bugfix: Illogical "Avoid computing higher temperatures on no_speech" (o…
Browse files Browse the repository at this point in the history
…penai#1903)

* Bugfix: Illogical "Avoid computing higher temperatures on no_speech"

Bugfix for openai#1279

It's "silence" when decoding has failed due to `compression_ratio_threshold` too, when further down the code it's not "silence" anymore.

"Silence" should be only when decoding has failed due to `logprob_threshold`.

Like described there:
https://github.com/openai/whisper/blob/8bc8860694949db53c42ba47ddc23786c2e02a8b/whisper/transcribe.py#L421

And in code there:
https://github.com/openai/whisper/blob/8bc8860694949db53c42ba47ddc23786c2e02a8b/whisper/transcribe.py#L243-L251

* Fix if "logprob_threshold=None"

---------

Co-authored-by: Jong Wook Kim <[email protected]>
  • Loading branch information
2 people authored and joelvaneenwyk committed Dec 31, 2024
1 parent 7c3c485 commit 07e961b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/whisper/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ def decode_with_fallback(segment: torch.Tensor) -> DecodingResult:
if (
no_speech_threshold is not None
and decode_result.no_speech_prob > no_speech_threshold
and logprob_threshold is not None
and decode_result.avg_logprob < logprob_threshold
):
needs_fallback = False # silence
if not needs_fallback:
Expand Down

0 comments on commit 07e961b

Please sign in to comment.