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 #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

1 comment on commit 78f1661

@kafan1986
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ggerganov There are too many print messages. Is there any parameter through which I can disable these print messages?

Loaded audio with length  232480
ne0 = 512
ne1 = 1500
 -1.0735   0.1280  -0.2467  -1.1021  -0.4528  -1.1222  -1.7173  -1.0843  -1.3917   1.4586 ...  -1.0718  -1.2338   0.5515   0.1523  -0.4427   0.4557   0.0957   0.5716   0.1130   0.1738 
whisper_encode: used_mem = 5.494751 MB, 14.648438 MB, 23.437500 MB 2.929688 MB 2.929688 MB

Please sign in to comment.