Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
leisuzz authored Sep 13, 2024
2 parents f7b7396 + 6dc6486 commit b3c2060
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/diffusers/loaders/lora_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,9 +699,10 @@ def set_lora_device(self, adapter_names: List[str], device: Union[torch.device,
module.lora_B[adapter_name].to(device)
# this is a param, not a module, so device placement is not in-place -> re-assign
if hasattr(module, "lora_magnitude_vector") and module.lora_magnitude_vector is not None:
module.lora_magnitude_vector[adapter_name] = module.lora_magnitude_vector[
adapter_name
].to(device)
if adapter_name in module.lora_magnitude_vector:
module.lora_magnitude_vector[adapter_name] = module.lora_magnitude_vector[
adapter_name
].to(device)

@staticmethod
def pack_weights(layers, prefix):
Expand Down

0 comments on commit b3c2060

Please sign in to comment.