diff --git a/src/llama-graph.cpp b/src/llama-graph.cpp index f69fe63f8..6cadda971 100644 --- a/src/llama-graph.cpp +++ b/src/llama-graph.cpp @@ -3978,6 +3978,10 @@ void llm_graph_context::build_pooling( ggml_tensor * cls_out_b, ggml_tensor * cls_norm) const { if (!cparams.embeddings) { + // a graph without logits still computes t_embd, so that it is never empty + if (res->t_logits == nullptr && res->t_embd != nullptr) { + ggml_build_forward_expand(gf, res->t_embd); + } return; }