mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-02-10 23:40:50 +01:00
whisper : fix segment length with params.no_timestamps == true
This commit is contained in:
parent
f7908f9bb8
commit
6b01e3fedd
@ -5469,7 +5469,7 @@ int whisper_full_with_state(
|
|||||||
(params.max_tokens > 0 && i >= params.max_tokens) || // max tokens per segment reached
|
(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
|
(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) {
|
if (seek + seek_delta + 100 >= seek_end) {
|
||||||
result_len = i + 1;
|
result_len = i + 1;
|
||||||
} else {
|
} 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;
|
result_len = i + 1;
|
||||||
seek_delta = 100*WHISPER_CHUNK_SIZE;
|
seek_delta = 100*WHISPER_CHUNK_SIZE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user