Unverified Commit 8d30d257 authored by Sayak Paul's avatar Sayak Paul Committed by GitHub
Browse files

[LoRA] default to None when fc alphas are not available. (#4706)

default to None when fc alphas are not available.
parent 1e0395e7
...@@ -1400,8 +1400,9 @@ class LoraLoaderMixin: ...@@ -1400,8 +1400,9 @@ class LoraLoaderMixin:
if patch_mlp: if patch_mlp:
for name, mlp_module in text_encoder_mlp_modules(text_encoder): for name, mlp_module in text_encoder_mlp_modules(text_encoder):
fc1_alpha = network_alphas.pop(name + ".fc1.lora_linear_layer.down.weight.alpha") fc1_alpha = network_alphas.pop(name + ".fc1.lora_linear_layer.down.weight.alpha", None)
fc2_alpha = network_alphas.pop(name + ".fc2.lora_linear_layer.down.weight.alpha") fc2_alpha = network_alphas.pop(name + ".fc2.lora_linear_layer.down.weight.alpha", None)
current_rank_fc1 = rank.pop(f"{name}.fc1.lora_linear_layer.up.weight") current_rank_fc1 = rank.pop(f"{name}.fc1.lora_linear_layer.up.weight")
current_rank_fc2 = rank.pop(f"{name}.fc2.lora_linear_layer.up.weight") current_rank_fc2 = rank.pop(f"{name}.fc2.lora_linear_layer.up.weight")
......
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