Skip to content

Commit 90db0de

Browse files
Purfviewjongwook
andauthored
Bugfix: Illogical "Avoid computing higher temperatures on no_speech" (ggml-org#1903)
* Bugfix: Illogical "Avoid computing higher temperatures on no_speech" Bugfix for openai/whisper#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]>
1 parent fc5ded7 commit 90db0de

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

whisper/transcribe.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ def decode_with_fallback(segment: torch.Tensor) -> DecodingResult:
214214
if (
215215
no_speech_threshold is not None
216216
and decode_result.no_speech_prob > no_speech_threshold
217+
and logprob_threshold is not None
218+
and decode_result.avg_logprob < logprob_threshold
217219
):
218220
needs_fallback = False # silence
219221
if not needs_fallback:

0 commit comments

Comments
 (0)