Skip to content

Commit e8ead38

Browse files
sayakpaulJimmy
authored andcommitted
add note about serialization (huggingface#6764)
1 parent 9f00770 commit e8ead38

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/source/en/tutorials/using_peft_for_inference.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,13 @@ pipe.fuse_lora(adapter_names=["pixel", "toy"])
206206
prompt = "toy_face of a hacker with a hoodie, pixel art"
207207
image = pipe(prompt, num_inference_steps=30, generator=torch.manual_seed(0)).images[0]
208208
```
209+
210+
## Saving a pipeline after fusing the adapters
211+
212+
To properly save a pipeline after it's been loaded with the adapters, it should be serialized like so:
213+
214+
```python
215+
pipe.fuse_lora(lora_scale=1.0)
216+
pipe.unload_lora_weights()
217+
pipe.save_pretrained("path-to-pipeline")
218+
```

0 commit comments

Comments
 (0)