From 4cf23a5a400b80002976275518530cadd2ed8899 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Tue, 2 Sep 2025 17:09:05 +0300 Subject: [PATCH] Can't do this inplace with all models --- custom_linear.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_linear.py b/custom_linear.py index 0126c0f..585c39a 100644 --- a/custom_linear.py +++ b/custom_linear.py @@ -107,7 +107,7 @@ class CustomLinear(nn.Linear): ).reshape(weight.shape) alpha = lora_diff[2] / lora_diff[1].shape[0] if lora_diff[2] is not None else 1.0 scale = lora_strength * alpha - weight.add_(patch_diff, alpha=scale) + weight.add(patch_diff, alpha=scale) return weight def remove_lora_from_module(module):