From 8e092616a9c172299eaf6b057802bc6646883997 Mon Sep 17 00:00:00 2001 From: jukofyork <69222624+jukofyork@users.noreply.github.com> Date: Sat, 22 Jun 2024 10:39:26 +0100 Subject: [PATCH] fixes #7999 The `build_command_r` forgot to add the control vector. --- llama.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/llama.cpp b/llama.cpp index a05a52b42..bb87ec058 100644 --- a/llama.cpp +++ b/llama.cpp @@ -11047,6 +11047,13 @@ struct llm_build_context { // add together residual + FFN + self-attention cur = ggml_add(ctx0, cur, inpL); cur = ggml_add(ctx0, cur, attn_out); + + // add control vector + ggml_tensor * layer_dir = lctx.cvec.tensor_for(il); + if (layer_dir != nullptr) { + cur = ggml_add(ctx0, cur, layer_dir); + } + cb(cur, "l_out", il); // input for next layer