From b37af1424ac21f863439eb4774da0455e7094620 Mon Sep 17 00:00:00 2001 From: Xuan Son Nguyen Date: Tue, 7 Jan 2025 22:32:26 +0100 Subject: [PATCH] use lora->get_scale --- src/llama.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/llama.cpp b/src/llama.cpp index d79b2ab13..97e716cd6 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -2632,9 +2632,8 @@ static struct ggml_tensor * llm_build_lora_mm( if (lora == nullptr) { continue; } - const float alpha = it.first->alpha; - const float rank = (float) lora->b->ne[0]; - const float scale = alpha ? it.second * alpha / rank : it.second; + const float adapter_scale = it.second; + const float scale = lora->get_scale(it.first->alpha, adapter_scale); struct ggml_tensor * ab_cur = ggml_mul_mat( ctx0, lora->b, ggml_mul_mat(ctx0, lora->a, cur)