Skip to content

Commit

Permalink
whisper : fix condition for providing past prompt (critical)
Browse files Browse the repository at this point in the history
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 ggerganov#419
  • Loading branch information
ggerganov committed Jan 22, 2023
1 parent 21c569b commit 78f1661
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion whisper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) };
Expand Down

0 comments on commit 78f1661

Please sign in to comment.