PEFT
A library of parameter-efficient fine-tuning methods, such as LoRA, that adapt large pretrained models to a task by training only a small number of extra parameters instead of the whole model.
PEFT implements parameter-efficient fine-tuning (PEFT) methods. These methods adapt a large pretrained model to a downstream task by fine-tuning only a small number of extra parameters instead of the whole model, cutting the computational and storage cost of fine-tuning while reaching performance comparable to fully fine-tuned models.
It integrates with Transformers for model training and inference, with Diffusers for managing different adapters, and with Accelerate for distributed training and inference on very large models. A model is prepared for training with a method such as LoRA by wrapping the base model and a PEFT configuration with a single function call, and in one documented example only 0.19% of a model's parameters are trained. Measured memory use for training a 12-billion-parameter model, for instance, drops from more than the available GPU memory under full fine-tuning to under 60GB of GPU memory with LoRA.
It installs with pip and is written in Python under the Apache-2.0 license.