From 487f89ec2e7856cc15ee5146c52d0ebfbad96fa2 Mon Sep 17 00:00:00 2001 From: Francis Couture-Harpin Date: Sun, 17 Mar 2024 15:23:44 -0400 Subject: [PATCH] llama : fix embedding conditions --- llama.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llama.cpp b/llama.cpp index 577c09495..538a3af32 100644 --- a/llama.cpp +++ b/llama.cpp @@ -8992,7 +8992,7 @@ static void llama_set_inputs(llama_context & lctx, const llama_batch & batch) { data[n_outputs++] = i; } } - } else if (lctx.logits_all || (cparams.embeddings && hparams.pooling_type != LLAMA_POOLING_TYPE_NONE)) { + } else if (lctx.logits_all || (cparams.embeddings && cparams.pooling_type != LLAMA_POOLING_TYPE_NONE)) { for (int i = 0; i < n_tokens; ++i) { data[i] = i; } @@ -9205,7 +9205,7 @@ static void llama_output_reserve(llama_context & lctx, int32_t n_outputs) { // TODO: use a per-batch flag for logits presence instead const bool has_logits = cparams.causal_attn; - const bool has_embd = cparams.embeddings && (!hparams.causal_attn || cparams.pooling_type == LLAMA_POOLING_TYPE_NONE); + const bool has_embd = cparams.embeddings && (hparams.causal_attn || cparams.pooling_type == LLAMA_POOLING_TYPE_NONE); if (!lctx.output_ids) { // never resized afterwards