Add layers_to_transform for lora_config (#1118)

This commit is contained in:
xzuyn
2024-01-15 21:29:55 -05:00
committed by GitHub
parent 9cd27b2f91
commit 8487b97cf3
4 changed files with 23 additions and 1 deletions

View File

@@ -694,6 +694,21 @@ class ValidationTest(BaseValidation):
validate_config(cfg)
def test_unfrozen_parameters_w_peft_layers_to_transform(self):
cfg = DictDefault(
{
"adapter": "lora",
"unfrozen_parameters": ["model.layers.2[0-9]+.block_sparse_moe.gate.*"],
"peft_layers_to_transform": [0, 1],
}
)
with pytest.raises(
ValueError,
match=r".*can have unexpected behavior*",
):
validate_config(cfg)
class ValidationCheckModelConfig(BaseValidation):
"""