Skip to content

Commit 6e2fe26

Browse files
committed
fix more for lora
1 parent 77b5fa5 commit 6e2fe26

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/diffusers/loaders/lora_base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,10 @@ def set_adapters(
557557
# Decompose weights into weights for denoiser and text encoders.
558558
_component_adapter_weights = {}
559559
for component in self._lora_loadable_modules:
560-
model = getattr(self, component)
561-
560+
model = getattr(self, component, None)
561+
if model is None:
562+
logger.warning(f"Model {component} not found in pipeline.")
563+
continue
562564
for adapter_name, weights in zip(adapter_names, adapter_weights):
563565
if isinstance(weights, dict):
564566
component_adapter_weights = weights.pop(component, None)

0 commit comments

Comments
 (0)