From b415e734e5227742082a33dd098bfa901e55ff62 Mon Sep 17 00:00:00 2001 From: Kawrakow Date: Wed, 3 Dec 2025 04:53:44 +0000 Subject: [PATCH] Fix also output --- src/llama-build-context.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/llama-build-context.cpp b/src/llama-build-context.cpp index fb7d407a..71e23a01 100644 --- a/src/llama-build-context.cpp +++ b/src/llama-build-context.cpp @@ -1668,10 +1668,15 @@ static ggml_tensor * build_output(llama_context & lctx, ggml_context * ctx, ggml } cb(o.back(), "output", id); } - if (o.size() == 1) cur = o.front(); - cur = ggml_concat(ctx, o[0], o[1], 0); - for (int id = 2; id < int(o.size()); ++id) { - cur = ggml_concat(ctx, cur, o[id], 0); + GGML_ASSERT(!o.empty()); + if (o.size() == 1) { + cur = o.front(); + } + else { + cur = ggml_concat(ctx, o[0], o[1], 0); + for (int id = 2; id < int(o.size()); ++id) { + cur = ggml_concat(ctx, cur, o[id], 0); + } } } else { if (output_norm) {