From 19dcce5c35c3eabe8fdc4a86a21d93f2b6a5b4e4 Mon Sep 17 00:00:00 2001 From: Paul Tsochantaris Date: Tue, 12 Dec 2023 19:02:42 +0000 Subject: [PATCH] Fix: State-setting assert fails when ctx->logits_all is false --- llama.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama.cpp b/llama.cpp index 54fa9e43e..d741cc4cb 100644 --- a/llama.cpp +++ b/llama.cpp @@ -9594,7 +9594,7 @@ size_t llama_set_state_data(struct llama_context * ctx, uint8_t * src) { memcpy(&logits_cap, inp, sizeof(logits_cap)); inp += sizeof(logits_cap); memcpy(&logits_size, inp, sizeof(logits_size)); inp += sizeof(logits_size); - GGML_ASSERT(ctx->logits.capacity() == logits_cap); + GGML_ASSERT((!ctx->logits_all) || (ctx->logits.capacity() == logits_cap)); if (logits_size) { ctx->logits.resize(logits_size);