utils.schemas.peft
utils.schemas.peft
Pydantic models for PEFT-related configuration
Classes
| Name | Description |
|---|---|
| LoftQConfig | LoftQ configuration subset |
| LoraConfig | Peft / LoRA configuration subset |
| PeftConfig | PEFT configuration subset |
| ReLoRAConfig | ReLoRA configuration subset |
LoftQConfig
utils.schemas.peft.LoftQConfig()LoftQ configuration subset
LoraConfig
utils.schemas.peft.LoraConfig()Peft / LoRA configuration subset
Methods
| Name | Description |
|---|---|
| normalize_base_quant_inputs | Funnel every legacy base-quant spelling into the canonical |
normalize_base_quant_inputs
utils.schemas.peft.LoraConfig.normalize_base_quant_inputs(data)Funnel every legacy base-quant spelling into the canonical
model_quantization_config structured form, emit deprecation
warnings, and then mirror back into load_in_4bit /
load_in_8bit for the downstream loader.
Why both directions? model_quantization_config is the new source
of truth and the only thing users should write; load_in_4bit /
load_in_8bit are kept alive (deprecated) for downstream loader
code that still keys off them. Putting the translation in a single
validator guarantees both representations end up in lockstep,
regardless of how the user spelled it.
Translations (legacy → canonical, all with deprecation warnings):
- adapter: qlora → adapter: lora + bnb nf4
- adapter: qlora + load_in_4bit: true
→ adapter: lora + bnb nf4
- load_in_4bit: true (alone) → bnb nf4
- load_in_8bit: true (alone) → bnb int8
PeftConfig
utils.schemas.peft.PeftConfig()PEFT configuration subset
ReLoRAConfig
utils.schemas.peft.ReLoRAConfig()ReLoRA configuration subset