mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-27 17:22:53 +03:00
[LoRA] fix: torch.compile() for lora conv (#5298)
fix: torch.compile() for lora conv
This commit is contained in:
@@ -164,7 +164,10 @@ class LoRACompatibleConv(nn.Conv2d):
|
||||
hidden_states, self.weight, self.bias, self.stride, self.padding, self.dilation, self.groups
|
||||
)
|
||||
else:
|
||||
return super().forward(hidden_states) + (scale * self.lora_layer(hidden_states))
|
||||
original_outputs = F.conv2d(
|
||||
hidden_states, self.weight, self.bias, self.stride, self.padding, self.dilation, self.groups
|
||||
)
|
||||
return original_outputs + (scale * self.lora_layer(hidden_states))
|
||||
|
||||
|
||||
class LoRACompatibleLinear(nn.Linear):
|
||||
|
||||
Reference in New Issue
Block a user