mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2024-11-07 08:34:37 +01:00
whisper : move new-segment callback after DTW step (#2515)
This commit is contained in:
parent
850f7b19d3
commit
1626b73b03
@ -6198,7 +6198,7 @@ int whisper_full_with_state(
|
||||
n_new = whisper_wrap_segment(*ctx, *state, params.max_len, params.split_on_word);
|
||||
}
|
||||
}
|
||||
if (params.new_segment_callback) {
|
||||
if (params.new_segment_callback && !ctx->params.dtw_token_timestamps) {
|
||||
params.new_segment_callback(ctx, state, n_new, params.new_segment_callback_user_data);
|
||||
}
|
||||
}
|
||||
@ -6243,7 +6243,7 @@ int whisper_full_with_state(
|
||||
n_new = whisper_wrap_segment(*ctx, *state, params.max_len, params.split_on_word);
|
||||
}
|
||||
}
|
||||
if (params.new_segment_callback) {
|
||||
if (params.new_segment_callback && !ctx->params.dtw_token_timestamps) {
|
||||
params.new_segment_callback(ctx, state, n_new, params.new_segment_callback_user_data);
|
||||
}
|
||||
}
|
||||
@ -6257,6 +6257,11 @@ int whisper_full_with_state(
|
||||
const int n_frames = std::min(std::min(WHISPER_CHUNK_SIZE * 100, seek_delta), seek_end - seek);
|
||||
whisper_exp_compute_token_level_timestamps_dtw(
|
||||
ctx, state, params, result_all.size() - n_segments, n_segments, seek, n_frames, 7, params.n_threads);
|
||||
if (params.new_segment_callback) {
|
||||
for (int seg = (int) result_all.size() - n_segments; seg < n_segments; seg++) {
|
||||
params.new_segment_callback(ctx, state, seg, params.new_segment_callback_user_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user