Skip to content

Commit

Permalink
Unload interum weights when doing multi lora fuse
Browse files Browse the repository at this point in the history
  • Loading branch information
jaretburkett committed Aug 18, 2024
1 parent 13a965a commit c458871
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions toolkit/stable_diffusion_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ def load_model(self):
)
pipe.load_lora_weights(double_transformer_lora, adapter_name=f"lora1_double")
pipe.fuse_lora()
pipe.unload_lora_weights()
transformer.transformer_blocks = transformer.transformer_blocks.to(
'cpu', dtype=dtype
)
Expand All @@ -567,6 +568,7 @@ def load_model(self):
)
pipe.load_lora_weights(single_transformer_lora, adapter_name=f"lora1_single")
pipe.fuse_lora()
pipe.unload_lora_weights()
transformer.single_transformer_blocks = transformer.single_transformer_blocks.to(
'cpu', dtype=dtype
)
Expand Down

0 comments on commit c458871

Please sign in to comment.