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)