1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

Fix Nonetype attribute error when loading multiple Flux loras (#10182)

Fix Nonetype attribute error
This commit is contained in:
Jonathan Yin
2024-12-11 00:03:33 -08:00
committed by GitHub
parent 43534a8d1f
commit 0967593400

View File

@@ -2313,7 +2313,7 @@ class FluxLoraLoaderMixin(LoraBaseMixin):
for name, module in transformer.named_modules():
if isinstance(module, torch.nn.Linear):
module_weight = module.weight.data
module_bias = module.bias.data if hasattr(module, "bias") else None
module_bias = module.bias.data if module.bias is not None else None
bias = module_bias is not None
lora_A_weight_name = f"{name}.lora_A.weight"