mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 09:04:36 +00:00
fix off-by-one npast during some instances of fast forwarding
This commit is contained in:
parent
f10574e598
commit
f125e724eb
3 changed files with 11 additions and 3 deletions
|
@ -464,9 +464,10 @@ void print_tok_vec(std::vector<float> &embd)
|
|||
|
||||
//fast forward the past based on identical tokens, stop once a divergence is noted
|
||||
int embd_inp_len = embd_inp.size();
|
||||
int cur_ctx_len = current_context_tokens.size();
|
||||
bool fastforwardok = true;
|
||||
|
||||
for (int i = 0; i < current_context_tokens.size(); ++i)
|
||||
for (int i = 0; i < cur_ctx_len; ++i)
|
||||
{
|
||||
if (current_context_tokens[i] == embd_inp[i])
|
||||
{
|
||||
|
@ -500,6 +501,10 @@ void print_tok_vec(std::vector<float> &embd)
|
|||
{
|
||||
break;
|
||||
}
|
||||
if ((i + 2) >= cur_ctx_len)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue