From 6c05cf7b0dd83cc90b9f4f86c80f4c9d22e3c5c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjarke=20Viks=C3=B8e?= Date: Thu, 4 Jul 2024 08:37:28 +0200 Subject: [PATCH] Skip initial timestamp --- src/whisper.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/whisper.cpp b/src/whisper.cpp index 0610a84c..b28bc982 100644 --- a/src/whisper.cpp +++ b/src/whisper.cpp @@ -6241,14 +6241,13 @@ int whisper_full_with_state( } text = ""; t0 = t1; - while (i < (int) tokens_cur.size() && tokens_cur[i].id > whisper_token_beg(ctx)) { + while (i + 1 < (int) tokens_cur.size() && tokens_cur[i + 1].id > whisper_token_beg(ctx)) { + i++; if (params.print_special) { text += whisper_token_to_str(ctx, tokens_cur[i].id); } t0 = seek + 2 * (tokens_cur[i].tid - whisper_token_beg(ctx)); - i++; } - i--; i0 = i + 1; speaker_turn_next = false; }