Update src/llama-model.cpp

Co-authored-by: Gabe Goodhart <ghart@us.ibm.com>
This commit is contained in:
Ryan Mangeno 2025-10-10 15:14:20 -04:00 committed by GitHub
parent a6306ce73e
commit 3581b68e06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -8098,6 +8098,11 @@ struct llm_build_modern_bert : public llm_graph_context {
Qcur, Kcur, Vcur, nullptr, nullptr, nullptr, 1.0f/sqrtf(float(n_embd_head)), il);
cb(cur, "kqv_out", il);
if (il == n_layer - 1 && inp_out_ids) {
cur = ggml_get_rows(ctx0, cur, inp_out_ids);
inpL = ggml_get_rows(ctx0, inpL, inp_out_ids);
}
// re-add the layer input
cur = ggml_add(ctx0, cur, inpL);