Method Stacking
About
Fine-tuning can combine several methods. The d9d.peft.all package groups multiple PEFT configurations into a single PeftStack. The stack injects its methods in order and merges them in reverse order.
Usage
This example applies LoRA to attention layers and fully fine-tunes normalization layers.
API Reference
d9d.peft.all
Stacking of several PEFT methods.
PeftStack
Bases: PeftMethod[PeftStackConfig]
PEFT method that applies a list of PEFT methods in order.
__init__(methods)
Constructs the PeftStack object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
methods
|
list[PeftMethod]
|
The PEFT methods to apply in order. |
required |
PeftStackConfig
peft_method_from_config(config)
Builds the PEFT method that matches the configuration type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
TConfig
|
A PEFT configuration object, e.g. |
required |
Returns:
| Type | Description |
|---|---|
PeftMethod[TConfig]
|
The corresponding method instance. |