Skip to content

Commit 61a17fa

Browse files
committed
fix: all-linear passed through CLI
Signed-off-by: Will Johnson <mwjohnson728@gmail.com>
1 parent f2ba2c3 commit 61a17fa

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tuning/sft_trainer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,15 @@ def train(
180180
module in (peft_config.target_modules or [])
181181
for module in restricted_modules
182182
)
183+
and fast_moe_config.fast_moe is not None
183184
):
184185
raise ValueError(
185186
"`--fast_moe` with LoRA does not currently support `all-linear`, as "
186187
"target modules at this time. Please explicitly specify target "
187188
"modules when using `--fast_moe` with LoRA."
188189
)
189190
# If other common non-linear modules, raise warning
190-
if peft_config is not None and hasattr(peft_config, "target_modules"):
191+
if peft_config is not None and hasattr(peft_config, "target_modules") and fast_moe_config.fast_moe is not None:
191192
logger.warning(
192193
"You are running lora with the ScatterMoE plugin, please note that "
193194
"passing target modules that are part of the moe module can cause unexpected "

0 commit comments

Comments
 (0)