Skip to content

Commit 4ac0ace

Browse files
bviksoeFlo Loferer
authored and
Flo Loferer
committed
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 6739eb8 commit 4ac0ace

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
@@ -6261,11 +6261,15 @@ int whisper_full_with_state(
62616261
}
62626262
}
62636263
text = "";
6264+
t0 = t1;
62646265
while (i < (int) tokens_cur.size() && tokens_cur[i].id > whisper_token_beg(ctx)) {
6266+
if (params.print_special) {
6267+
text += whisper_token_to_str(ctx, tokens_cur[i].id);
6268+
}
6269+
t0 = seek + 2 * (tokens_cur[i].tid - whisper_token_beg(ctx));
62656270
i++;
62666271
}
62676272
i--;
6268-
t0 = t1;
62696273
i0 = i + 1;
62706274
speaker_turn_next = false;
62716275
}
@@ -6282,8 +6286,8 @@ int whisper_full_with_state(
62826286
printf("[%s --> %s] %s\n", to_timestamp(tt0).c_str(), to_timestamp(tt1).c_str(), text.c_str());
62836287
} else {
62846288
printf("%s", text.c_str());
6285-
fflush(stdout);
62866289
}
6290+
fflush(stdout);
62876291
}
62886292

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

0 commit comments

Comments
 (0)