ref #68, #79 : fix segment time output

This commit is contained in:
Georgi Gerganov
2022-10-23 13:29:36 +03:00
parent 181b762de8
commit 5f7e9fa2dc
2 changed files with 10 additions and 5 deletions

View File

@@ -2526,7 +2526,7 @@ int whisper_full(
// store the text from this iteration
if (tokens_cur.size() > 0) {
int i0 = 0;
auto t0 = 2*(tokens_cur.front().tid - whisper_token_beg(ctx));
auto t0 = seek + 2*(tokens_cur.front().tid - whisper_token_beg(ctx));
std::string text = "";
@@ -2540,7 +2540,7 @@ int whisper_full(
text += whisper_token_to_str(ctx, tokens_cur[i].id);
}
if (tokens_cur[i].id > whisper_token_beg(ctx)) {
const auto t1 = 2*(tokens_cur[i].tid - whisper_token_beg(ctx));
const auto t1 = seek + 2*(tokens_cur[i].tid - whisper_token_beg(ctx));
if (!text.empty()) {
if (params.print_realtime) {
if (params.print_timestamps) {