| 90 | |
| 91 | |
| 92 | class LoRAConfig(BaseModel): |
| 93 | enable_lm: bool = False # Apply LoRA to base_lm + residual_lm |
| 94 | enable_dit: bool = False # Apply LoRA to VoxCPMLocDiT |
| 95 | enable_proj: bool = False # Apply LoRA to projection Linear layers |
| 96 | |
| 97 | r: int = 8 |
| 98 | alpha: int = 16 |
| 99 | dropout: float = 0.0 |
| 100 | |
| 101 | # Target linear layer names for LM & DiT (matched by attribute name) |
| 102 | target_modules_lm: list[str] = ["q_proj", "v_proj", "k_proj", "o_proj"] |
| 103 | target_modules_dit: list[str] = ["q_proj", "v_proj", "k_proj", "o_proj"] |
| 104 | # Projection layer attribute names to find on VoxCPMModel |
| 105 | target_proj_modules: list[str] = ["enc_to_lm_proj", "lm_to_dit_proj", "res_to_dit_proj"] |
| 106 | |
| 107 | |
| 108 | VoxCPMConfig.model_rebuild() |
no outgoing calls
searching dependent graphs…