Skip to content

Commit 3581b68

Browse files
Update src/llama-model.cpp
Co-authored-by: Gabe Goodhart <[email protected]>
1 parent a6306ce commit 3581b68

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/llama-model.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8098,6 +8098,11 @@ struct llm_build_modern_bert : public llm_graph_context {
80988098
Qcur, Kcur, Vcur, nullptr, nullptr, nullptr, 1.0f/sqrtf(float(n_embd_head)), il);
80998099
cb(cur, "kqv_out", il);
81008100

8101+
if (il == n_layer - 1 && inp_out_ids) {
8102+
cur = ggml_get_rows(ctx0, cur, inp_out_ids);
8103+
inpL = ggml_get_rows(ctx0, inpL, inp_out_ids);
8104+
}
8105+
81018106
// re-add the layer input
81028107
cur = ggml_add(ctx0, cur, inpL);
81038108

0 commit comments

Comments
 (0)