]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
whisper : fix condition for providing past prompt (critical)
authorGeorgi Gerganov <redacted>
Sun, 22 Jan 2023 08:47:01 +0000 (10:47 +0200)
committerGeorgi Gerganov <redacted>
Sun, 22 Jan 2023 08:47:01 +0000 (10:47 +0200)
This 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

index 6014cb187e3cf4245c17a8ac85c38f0a62873d55..81458a59f63508264a10cd7914d4ea8e065c7ba2 100644 (file)
@@ -3449,7 +3449,7 @@ int whisper_full(
                 prompt.clear();
 
                 // if we have already generated some text, use it as a prompt to condition the next generation
-                if (!prompt_past.empty() && t_cur > 0.5f) {
+                if (!prompt_past.empty() && t_cur < 0.5f) {
                     int n_take = std::min(std::min(params.n_max_text_ctx, whisper_n_text_ctx(ctx)/2), int(prompt_past.size()));
 
                     prompt = { whisper_token_prev(ctx) };