MCPcopy Index your code
hub / github.com/huggingface/diffusers / active_adapters

Method active_adapters

src/diffusers/loaders/peft.py:640–659  ·  view source on GitHub ↗

Gets the current list of active adapters of the model. If you are not familiar with adapters and PEFT methods, we invite you to read more about them on the PEFT [documentation](https://huggingface.co/docs/peft).

(self)

Source from the content-addressed store, hash-verified

638 module.disable_adapters = False
639
640 def active_adapters(self) -> list[str]:
641 """
642 Gets the current list of active adapters of the model.
643
644 If you are not familiar with adapters and PEFT methods, we invite you to read more about them on the PEFT
645 [documentation](https://huggingface.co/docs/peft).
646 """
647 check_peft_version(min_version=MIN_PEFT_VERSION)
648
649 if not is_peft_available():
650 raise ImportError("PEFT is not available. Please install PEFT to use this function: `pip install peft`.")
651
652 if not self._hf_peft_config_loaded:
653 raise ValueError("No adapter loaded. Please load an adapter first.")
654
655 from peft.tuners.tuners_utils import BaseTunerLayer
656
657 for _, module in self.named_modules():
658 if isinstance(module, BaseTunerLayer):
659 return module.active_adapter
660
661 def fuse_lora(self, lora_scale=1.0, safe_fusing=False, adapter_names=None):
662 if not USE_PEFT_BACKEND:

Callers

nothing calls this directly

Calls 2

check_peft_versionFunction · 0.85
is_peft_availableFunction · 0.85

Tested by

no test coverage detected