We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e4df91b commit 781fb2cCopy full SHA for 781fb2c
1 file changed
modelopt/torch/peft/config.py
@@ -92,6 +92,10 @@ class PEFTAttributeConfig(ModeloptBaseConfig):
92
@classmethod
93
def _parse_init_callable(cls, v):
94
if isinstance(v, str):
95
+ if not v.startswith("torch.nn.init."):
96
+ raise ValueError(
97
+ f"Initializer must be from 'torch.nn.init', got '{v}'"
98
+ )
99
try:
100
module_path, func_name = v.rsplit(".", 1)
101
mod = importlib.import_module(module_path)
0 commit comments