From c0d93d0829ccbf658e68b6b80ec0c2650bc902a8 Mon Sep 17 00:00:00 2001 From: Guillaume Klein Date: Mon, 3 Jul 2023 10:20:36 +0200 Subject: [PATCH] Avoid computing higher temperatures on no_speech segments (#225) Port commit https://github.com/openai/whisper/commit/e334ff141d5444fbf6904edaaf408e5b0b416fe8 --- faster_whisper/transcribe.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/faster_whisper/transcribe.py b/faster_whisper/transcribe.py index b88686e..017d398 100644 --- a/faster_whisper/transcribe.py +++ b/faster_whisper/transcribe.py @@ -649,6 +649,12 @@ class WhisperModel: options.log_prob_threshold, ) + if ( + options.no_speech_threshold is not None + and result.no_speech_prob > options.no_speech_threshold + ): + needs_fallback = False # silence + if not needs_fallback: break