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
8d7dc853
Unverified
Commit
8d7dc853
authored
Jan 31, 2024
by
Sayak Paul
Committed by
GitHub
Jan 31, 2024
Browse files
add note about serialization (#6764)
parent
87a92f77
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
docs/source/en/tutorials/using_peft_for_inference.md
docs/source/en/tutorials/using_peft_for_inference.md
+10
-0
No files found.
docs/source/en/tutorials/using_peft_for_inference.md
View file @
8d7dc853
...
...
@@ -206,3 +206,13 @@ pipe.fuse_lora(adapter_names=["pixel", "toy"])
prompt
=
"toy_face of a hacker with a hoodie, pixel art"
image
=
pipe
(
prompt
,
num_inference_steps
=
30
,
generator
=
torch
.
manual_seed
(
0
)).
images
[
0
]
```
## Saving a pipeline after fusing the adapters
To properly save a pipeline after it's been loaded with the adapters, it should be serialized like so:
```
python
pipe
.
fuse_lora
(
lora_scale
=
1.0
)
pipe
.
unload_lora_weights
()
pipe
.
save_pretrained
(
"path-to-pipeline"
)
```
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