From 1cd8df5c00e519991ecdce9cbf1f89171303f447 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Wed, 29 Oct 2025 02:50:11 +0200 Subject: [PATCH] Update custom_linear.py --- custom_linear.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_linear.py b/custom_linear.py index 0c45f30..a4bc6d3 100644 --- a/custom_linear.py +++ b/custom_linear.py @@ -131,7 +131,7 @@ class CustomLinear(nn.Linear): patch_diff = torch.mm( lora_diff_0.flatten(start_dim=1), lora_diff_1.flatten(start_dim=1) - ).reshape(weight.shape) + ).reshape(weight.shape) + 0 alpha = lora_diff_2 / lora_diff_1.shape[0] if lora_diff_2 is not None else 1.0 scale = lora_strength * alpha weight = weight.add(patch_diff, alpha=scale)