graph : add optional scale parameter to build_lora_mm [no ci] (#20427)
This commit is contained in:
parent
4a748b8f15
commit
1eea6a2968
6 changed files with 23 additions and 59 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue