From 712bc4b960bfacf7a935190c341d14234dedfcfc Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Sat, 14 Jan 2023 14:11:22 +0200 Subject: [PATCH] whisper : fix prompt_past update to not include prompt_init --- whisper.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/whisper.cpp b/whisper.cpp index 6a1da95..38c994d 100644 --- a/whisper.cpp +++ b/whisper.cpp @@ -3180,9 +3180,9 @@ int whisper_full( ctx->decoders[i].sequence.tokens.reserve(ctx->decoders[0].sequence.tokens.capacity()); - ctx->decoders[i].probs.reserve (ctx->vocab.n_vocab); - ctx->decoders[i].logits.reserve (ctx->vocab.n_vocab); - ctx->decoders[i].logprobs.reserve(ctx->vocab.n_vocab); + ctx->decoders[i].probs.resize (ctx->vocab.n_vocab); + ctx->decoders[i].logits.resize (ctx->vocab.n_vocab); + ctx->decoders[i].logprobs.resize(ctx->vocab.n_vocab); } } @@ -3557,7 +3557,7 @@ int whisper_full( // update prompt_past prompt_past.clear(); - prompt_past.insert(prompt_past.end(), prompt.begin() + 1, prompt.end()); + prompt_past.insert(prompt_past.end(), prompt.begin() + 1, prompt.end() - prompt_init.size()); for (int i = 0; i < result_len; ++i) { prompt_past.push_back(tokens_cur[i].id);