From 11b1564efb0690ff9df764e6b8dba700f5ec6f27 Mon Sep 17 00:00:00 2001 From: Xuan Son Nguyen Date: Tue, 22 Oct 2024 13:14:38 +0200 Subject: [PATCH] add GGML_ASSERT --- src/llama.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/llama.cpp b/src/llama.cpp index 3c6d9c363..669c5f28e 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -5202,6 +5202,7 @@ struct llama_batch_allocr { // optionally fulfill the batch returned by llama_batch_get_one llama_batch_allocr(llama_context & ctx, struct llama_batch in_batch) { batch = in_batch; + GGML_ASSERT(batch.n_tokens > 0); if (!batch.pos) { // determine the last position in KV cache llama_pos last_pos = -1;