"apps/life_sci/tests/utils/test_rdkit_utils.py" did not exist on "e4948c5cbce13a054d639c5b4f0be20ba166d68e"
Unverified Commit 329771e5 authored by Sayak Paul's avatar Sayak Paul Committed by GitHub
Browse files

[LoRA] improve failure handling for peft. (#10551)



* improve failure handling for peft.

* emppty

* Update src/diffusers/loaders/peft.py
Co-authored-by: default avatarBenjamin Bossan <BenjaminBossan@users.noreply.github.com>

---------
Co-authored-by: default avatarBenjamin Bossan <BenjaminBossan@users.noreply.github.com>
parent f7cb5954
......@@ -300,7 +300,9 @@ class PeftAdapterMixin:
try:
inject_adapter_in_model(lora_config, self, adapter_name=adapter_name, **peft_kwargs)
incompatible_keys = set_peft_model_state_dict(self, state_dict, adapter_name, **peft_kwargs)
except RuntimeError as e:
except Exception as e:
# In case `inject_adapter_in_model()` was unsuccessful even before injecting the `peft_config`.
if hasattr(self, "peft_config"):
for module in self.modules():
if isinstance(module, BaseTunerLayer):
active_adapters = module.active_adapters
......
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