mirror of
https://github.com/Lizonghang/prima.cpp.git
synced 2025-09-10 13:14:33 +00:00
Merge branch 'dev' into feat/auto-exit
This commit is contained in:
commit
7b0ededd24
10 changed files with 488 additions and 87 deletions
|
@ -351,6 +351,9 @@ int main(int argc, char ** argv) {
|
|||
|
||||
// remove any "future" tokens that we might have inherited from the previous session
|
||||
llama_kv_cache_seq_rm(ctx, -1, n_matching_session_tokens, -1);
|
||||
if (my_rank == 0) {
|
||||
llama_send_kv_cache_seq_rm(ctx, -1, n_matching_session_tokens, -1);
|
||||
}
|
||||
}
|
||||
|
||||
LOG_DBG("recalculate the cached logits (check): embd_inp.size() %zu, n_matching_session_tokens %zu, embd_inp.size() %zu, session_tokens.size() %zu\n",
|
||||
|
@ -596,6 +599,11 @@ int main(int argc, char ** argv) {
|
|||
llama_kv_cache_seq_rm (ctx, 0, params.n_keep , params.n_keep + n_discard);
|
||||
llama_kv_cache_seq_add(ctx, 0, params.n_keep + n_discard, n_past, -n_discard);
|
||||
|
||||
if (my_rank == 0) {
|
||||
llama_send_kv_cache_seq_rm (ctx, 0, params.n_keep , params.n_keep + n_discard);
|
||||
llama_send_kv_cache_seq_add(ctx, 0, params.n_keep + n_discard, n_past, -n_discard);
|
||||
}
|
||||
|
||||
n_past -= n_discard;
|
||||
|
||||
LOG_DBG("after swap: n_past = %d\n", n_past);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue