File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -297,6 +297,9 @@ int main(int argc, char ** argv) {
297297 LOG_TEE (" %s: session file matches %zu / %zu tokens of prompt\n " ,
298298 __func__, n_matching_session_tokens, embd_inp.size ());
299299 }
300+
301+ // remove any "future" tokens that we might have inherited from the previous session
302+ llama_kv_cache_tokens_rm (ctx, n_matching_session_tokens, -1 );
300303 }
301304
302305 LOGLN (
@@ -545,9 +548,6 @@ int main(int argc, char ** argv) {
545548 if (i > 0 ) {
546549 embd.erase (embd.begin (), embd.begin () + i);
547550 }
548-
549- // remove any "future" tokens that we might have inherited from the session from the KV cache
550- llama_kv_cache_tokens_rm (ctx, n_past, -1 );
551551 }
552552
553553 // evaluate tokens in batches
You can’t perform that action at this time.
0 commit comments