graph : add optional scale parameter to build_lora_mm [no ci] (#20427)

This commit is contained in:
Richard Davison 2026-03-12 00:22:49 +01:00 committed by GitHub
parent 4a748b8f15
commit 1eea6a2968
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 23 additions and 59 deletions

View file

@ -900,7 +900,8 @@ ggml_tensor * llm_graph_context::build_cvec(
ggml_tensor * llm_graph_context::build_lora_mm(
ggml_tensor * w,
ggml_tensor * cur) const {
ggml_tensor * cur,
ggml_tensor * w_s) const {
ggml_tensor * res = ggml_mul_mat(ctx0, w, cur);
for (const auto & lora : *loras) {
@ -921,6 +922,10 @@ ggml_tensor * llm_graph_context::build_lora_mm(
res = ggml_add(ctx0, res, ab_cur);
}
if (w_s) {
res = ggml_mul(ctx0, res, w_s);
}
return res;
}