Spaces:
Running
Running
whisper : fix condition for providing past prompt (critical)
Browse filesThis bug has been present since v1.1.0.
Effectively, the past transcribed text wasn't being used for following
transcriptions, which likely significantly reduces the transcription
quality.
Likely related to #419
- whisper.cpp +1 -1
whisper.cpp
CHANGED
|
@@ -3449,7 +3449,7 @@ int whisper_full(
|
|
| 3449 |
prompt.clear();
|
| 3450 |
|
| 3451 |
// if we have already generated some text, use it as a prompt to condition the next generation
|
| 3452 |
-
if (!prompt_past.empty() && t_cur
|
| 3453 |
int n_take = std::min(std::min(params.n_max_text_ctx, whisper_n_text_ctx(ctx)/2), int(prompt_past.size()));
|
| 3454 |
|
| 3455 |
prompt = { whisper_token_prev(ctx) };
|
|
|
|
| 3449 |
prompt.clear();
|
| 3450 |
|
| 3451 |
// if we have already generated some text, use it as a prompt to condition the next generation
|
| 3452 |
+
if (!prompt_past.empty() && t_cur < 0.5f) {
|
| 3453 |
int n_take = std::min(std::min(params.n_max_text_ctx, whisper_n_text_ctx(ctx)/2), int(prompt_past.size()));
|
| 3454 |
|
| 3455 |
prompt = { whisper_token_prev(ctx) };
|