"git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "f0725c5845b150b3042e9e98b1cda154d3bef5b5"
Unverified Commit 6dc64865 authored by Sayak Paul's avatar Sayak Paul Committed by GitHub
Browse files

[LoRA] fix adapter movement when using DoRA. (#9411)

fix adapter movement when using DoRA.
parent 1e8cf276
...@@ -699,9 +699,10 @@ class LoraBaseMixin: ...@@ -699,9 +699,10 @@ class LoraBaseMixin:
module.lora_B[adapter_name].to(device) module.lora_B[adapter_name].to(device)
# this is a param, not a module, so device placement is not in-place -> re-assign # 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: if hasattr(module, "lora_magnitude_vector") and module.lora_magnitude_vector is not None:
module.lora_magnitude_vector[adapter_name] = module.lora_magnitude_vector[ if adapter_name in module.lora_magnitude_vector:
adapter_name module.lora_magnitude_vector[adapter_name] = module.lora_magnitude_vector[
].to(device) adapter_name
].to(device)
@staticmethod @staticmethod
def pack_weights(layers, prefix): def pack_weights(layers, prefix):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment