From c6a8a4703984e58dba2d45f538d25f83337ec8cf Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Sat, 14 Jan 2023 17:48:02 +0200 Subject: [PATCH] whisper : handle empty sequence ranking --- whisper.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/whisper.cpp b/whisper.cpp index 45181e3..b964aa1 100644 --- a/whisper.cpp +++ b/whisper.cpp @@ -3094,7 +3094,9 @@ static whisper_token_data whisper_sample_token( static void whisper_sequence_score( const struct whisper_full_params & params, whisper_sequence & sequence) { - WHISPER_ASSERT(sequence.result_len > 0); + if (sequence.result_len == 0) { + return; + } double result = 0.0f;