Skip to content

Commit 3f5b99c

Browse files
bviksoepalana
authored andcommitted
Incorrect timetstamps
Fixes ggml-org#2271 - Adds consecutive timestamps after end of last segment as the new starting ts - Add these timestamp to output when "print-special" enabled - Fixes fflush usage in live reporting I was not able to test this with the special "token_timestamps" option.
1 parent f68298c commit 3f5b99c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/whisper.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -6258,11 +6258,15 @@ int whisper_full_with_state(
62586258
}
62596259
}
62606260
text = "";
6261+
t0 = t1;
62616262
while (i < (int) tokens_cur.size() && tokens_cur[i].id > whisper_token_beg(ctx)) {
6263+
if (params.print_special) {
6264+
text += whisper_token_to_str(ctx, tokens_cur[i].id);
6265+
}
6266+
t0 = seek + 2 * (tokens_cur[i].tid - whisper_token_beg(ctx));
62626267
i++;
62636268
}
62646269
i--;
6265-
t0 = t1;
62666270
i0 = i + 1;
62676271
speaker_turn_next = false;
62686272
}
@@ -6279,8 +6283,8 @@ int whisper_full_with_state(
62796283
printf("[%s --> %s] %s\n", to_timestamp(tt0).c_str(), to_timestamp(tt1).c_str(), text.c_str());
62806284
} else {
62816285
printf("%s", text.c_str());
6282-
fflush(stdout);
62836286
}
6287+
fflush(stdout);
62846288
}
62856289

62866290
result_all.push_back({ tt0, tt1, text, {} , speaker_turn_next });

0 commit comments

Comments
 (0)