Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
diffusers
Commits
cbbad0af
Commit
cbbad0af
authored
Mar 08, 2023
by
Patrick von Platen
Browse files
correct example
parent
00132de3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
3 deletions
+0
-3
examples/research_projects/lora/train_text_to_image_lora.py
examples/research_projects/lora/train_text_to_image_lora.py
+0
-3
No files found.
examples/research_projects/lora/train_text_to_image_lora.py
View file @
cbbad0af
...
...
@@ -479,7 +479,6 @@ def main():
weight_dtype
=
torch
.
bfloat16
if
args
.
use_peft
:
from
peft
import
LoraConfig
,
LoraModel
,
get_peft_model_state_dict
,
set_peft_model_state_dict
UNET_TARGET_MODULES
=
[
"to_q"
,
"to_v"
,
"query"
,
"value"
]
...
...
@@ -496,7 +495,6 @@ def main():
vae
.
requires_grad_
(
False
)
if
args
.
train_text_encoder
:
config
=
LoraConfig
(
r
=
args
.
lora_text_encoder_r
,
lora_alpha
=
args
.
lora_text_encoder_alpha
,
...
...
@@ -506,7 +504,6 @@ def main():
)
text_encoder
=
LoraModel
(
config
,
text_encoder
)
else
:
# freeze parameters of models to save more memory
unet
.
requires_grad_
(
False
)
vae
.
requires_grad_
(
False
)
...
...
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