Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
7eaae83f
Unverified
Commit
7eaae83f
authored
Oct 06, 2023
by
Sayak Paul
Committed by
GitHub
Oct 06, 2023
Browse files
[LoRA] fix: torch.compile() for lora conv (#5298)
fix: torch.compile() for lora conv
parent
872ae1dd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/diffusers/models/lora.py
src/diffusers/models/lora.py
+4
-1
No files found.
src/diffusers/models/lora.py
View file @
7eaae83f
...
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment