From ebcfd6b9646f5176fba8b7f3429d0de28a70192c Mon Sep 17 00:00:00 2001 From: Purfview <69023953+Purfview@users.noreply.github.com> Date: Wed, 13 Dec 2023 12:14:39 +0000 Subject: [PATCH] Fix broken prompt_reset_on_temperature (#604) * Fix broken prompt_reset_on_temperature Fixing: https://github.com/SYSTRAN/faster-whisper/issues/603 Broken because `generate_with_fallback()` doesn't return final temperature. Regression since PR356 -> https://github.com/SYSTRAN/faster-whisper/pull/356 --- faster_whisper/transcribe.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/faster_whisper/transcribe.py b/faster_whisper/transcribe.py index c082546..7996321 100644 --- a/faster_whisper/transcribe.py +++ b/faster_whisper/transcribe.py @@ -731,6 +731,13 @@ class WhisperModel: decode_result = max( below_cr_threshold_results or all_results, key=lambda x: x[1] ) + # to pass final temperature for prompt_reset_on_temperature + decode_result = ( + decode_result[0], + decode_result[1], + temperature, + decode_result[3], + ) return decode_result