A collection of helper functions for PEFT.
( model_name_or_path: str ) → bool
Check if the model is a PEFT model.
( model alpha )
Context manager to temporarily set the scaling of the LoRA adapter in a model.
The original scaling values are restored when the context manager exits. This context manager works with the transformers and diffusers models that have directly loaded LoRA adapters.