From ce0bae1839d89e2caf0552664f9404319fa1ece2 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Tue, 8 Jul 2025 16:23:29 +0300 Subject: [PATCH] revert this --- gguf/gguf.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gguf/gguf.py b/gguf/gguf.py index d835211..e3a001a 100644 --- a/gguf/gguf.py +++ b/gguf/gguf.py @@ -83,7 +83,6 @@ class GGUFLinear(nn.Linear): def forward(self, inputs): weight = dequantize_without_compile(self.weight) - temp_weight = weight.to(torch.float32) weight = weight.to(self.compute_dtype) bias = self.bias.to(self.compute_dtype) if self.bias is not None else None @@ -92,12 +91,12 @@ class GGUFLinear(nn.Linear): for lora_diff, lora_strength, lora_alpha in zip(self.lora_diffs, self.lora_strengths, self.lora_alphas): # Calculate the diff for this patch patch_diff = torch.mm( - lora_diff[0].flatten(start_dim=1).to(temp_weight.device), - lora_diff[1].flatten(start_dim=1).to(temp_weight.device) + lora_diff[0].flatten(start_dim=1).to(weight.device), + lora_diff[1].flatten(start_dim=1).to(weight.device) ).reshape(weight.shape) # Apply the patch with its strength - weight = (temp_weight + ((lora_strength * lora_alpha) * patch_diff)).to(self.compute_dtype) + weight = weight + ((lora_strength * lora_alpha) * patch_diff).to(self.compute_dtype) output = torch.nn.functional.linear(inputs, weight, bias) return output \ No newline at end of file