Skip to content

Commit

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

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

Bugfix for #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 <jongwook@openai.com>
  • Loading branch information
Purfview and jongwook authored Dec 1, 2024
1 parent fc5ded7 commit 90db0de
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions whisper/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,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 90db0de

Please sign in to comment.