Skip to content

Commit f98711e

Browse files
committed
Some minor updates
Signed-off-by: Jingyu Xin <[email protected]>
1 parent 98ef9fb commit f98711e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

modelopt/torch/peft/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class PEFTConfig(ModeloptBaseConfig):
115115
)
116116

117117
adapter_cfg: PEFTAdapterCfgType = ModeloptField(
118-
default={"default": {"rank": 128}},
118+
default={"*": {"rank": 64}},
119119
title="Adapter configuration",
120120
description="Configuration for adapters. Maps module patterns to PEFTAttributeConfig or dict.",
121121
validate_default=True,

modelopt/torch/peft/convert.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ def _set_adapter_state(model, enable_state, layer_patterns=None, adapter_pattern
9898
layer_patterns: Optional list of layer name patterns (wildcards or callables)
9999
adapter_patterns: Optional list of adapter name patterns (wildcards)
100100
"""
101-
assert is_peft_model(model), "It's not a MO-PEFT model"
101+
if not is_peft_model(model):
102+
raise ValueError("Model must be a PEFT model to set adapter states.")
102103

103104
def matches_any_pattern(name, patterns, allow_callable=True):
104105
for pattern in patterns:

0 commit comments

Comments
 (0)