From: Georgi Gerganov Date: Fri, 12 Jan 2024 11:37:38 +0000 (+0200) Subject: whisper : fix segment length with params.no_timestamps == true X-Git-Tag: upstream/1.7.4~1137 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=6b01e3fedd01c5c60ea161c229b308554f3071d3;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp whisper : fix segment length with params.no_timestamps == true --- diff --git a/whisper.cpp b/whisper.cpp index 93f3063c..ca39b58a 100644 --- a/whisper.cpp +++ b/whisper.cpp @@ -127,7 +127,7 @@ static void whisper_log_callback_default(ggml_log_level level, const char * text #define WHISPER_LOG_INFO(...) whisper_log_internal(GGML_LOG_LEVEL_INFO , __VA_ARGS__) // define this to enable verbose trace logging - useful for debugging purposes -// #define WHISPER_DEBUG +//#define WHISPER_DEBUG #if defined(WHISPER_DEBUG) #define WHISPER_LOG_DEBUG(...) whisper_log_internal(GGML_LOG_LEVEL_DEBUG, __VA_ARGS__) @@ -5469,7 +5469,7 @@ int whisper_full_with_state( (params.max_tokens > 0 && i >= params.max_tokens) || // max tokens per segment reached (has_ts && seek + seek_delta + 100 >= seek_end) // end of audio reached ) { - if (result_len == 0) { + if (result_len == 0 && !params.no_timestamps) { if (seek + seek_delta + 100 >= seek_end) { result_len = i + 1; } else { @@ -5479,7 +5479,7 @@ int whisper_full_with_state( } } - if (params.single_segment) { + if (params.single_segment || params.no_timestamps) { result_len = i + 1; seek_delta = 100*WHISPER_CHUNK_SIZE; }