Spaces:
Running
Running
Fix EOT token handling
Browse filesIf it is the end of the audio, pick all sampled tokens.
Otherwise, print error message.
- whisper.cpp +6 -3
whisper.cpp
CHANGED
|
@@ -2445,9 +2445,12 @@ int whisper_full(
|
|
| 2445 |
// end of text token
|
| 2446 |
if (id == whisper_token_eot(ctx)) {
|
| 2447 |
if (result_len == 0) {
|
| 2448 |
-
|
| 2449 |
-
|
| 2450 |
-
|
|
|
|
|
|
|
|
|
|
| 2451 |
}
|
| 2452 |
break;
|
| 2453 |
}
|
|
|
|
| 2445 |
// end of text token
|
| 2446 |
if (id == whisper_token_eot(ctx)) {
|
| 2447 |
if (result_len == 0) {
|
| 2448 |
+
if (seek + seek_delta + 100 >= whisper_n_len(ctx)) {
|
| 2449 |
+
result_len = i + 1;
|
| 2450 |
+
} else {
|
| 2451 |
+
// TODO: figure out how to resolve this
|
| 2452 |
+
fprintf(stderr, "\n%s: failed to generate timestamp token - this should not happen\n\n", __func__);
|
| 2453 |
+
}
|
| 2454 |
}
|
| 2455 |
break;
|
| 2456 |
}
|