From 7d14b33981c2877f647ffb76ff7d25437b8f3a3d Mon Sep 17 00:00:00 2001 From: l3utterfly Date: Tue, 3 Oct 2023 03:23:42 +0800 Subject: [PATCH] fixed bug where kv_self.size is being set wrongly to the buffer size instead of the context size --- llama.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama.cpp b/llama.cpp index 05b570bd12ee2..19a3c7ef8aace 100644 --- a/llama.cpp +++ b/llama.cpp @@ -7276,7 +7276,7 @@ size_t llama_set_state_data(struct llama_context * ctx, uint8_t * src) { } ctx->kv_self.head = kv_ntok; - ctx->kv_self.size = kv_size; + ctx->kv_self.size = n_ctx; } const size_t nread = inp - src;