From f356e277697efaa85642bf7d93d82c377c82ce2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Szymczyk?= Date: Sat, 10 Aug 2024 10:32:15 +0200 Subject: [PATCH] llama : for clarity set is_encoding to true before building worst-case graph only if the model contains encoder --- src/llama.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/llama.cpp b/src/llama.cpp index ce502b9c9..9c4f2aa72 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -16706,7 +16706,8 @@ struct llama_context * llama_new_context_with_model( ctx->sampling.rng = std::mt19937(params.seed); ctx->logits_all = params.logits_all; - ctx->is_encoding = true; + // build worst-case graph for encoder if a model contains encoder + ctx->is_encoding = llama_model_has_encoder(model); uint32_t kv_size = cparams.n_ctx; ggml_type type_k = params.type_k;