Skip to content

Commit fb21e7b

Browse files
committed
fix: exclude modules (requires peft update)
Signed-off-by: Will Johnson <mwjohnson728@gmail.com>
1 parent 699444f commit fb21e7b

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ dependencies = [
3535
"tokenizers>=0.13.3,<1.0",
3636
"tqdm>=4.66.2,<5.0",
3737
"trl>=0.13,<0.18",
38-
"peft>=0.8.0,<0.14",
38+
"peft>=0.8.0,<0.15",
3939
"protobuf>=5.28.0,<6.0.0",
4040
"datasets>=2.15.0,<4.0",
4141
"simpleeval>=0.9.13,<2.0",

tuning/sft_trainer.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ def train(
167167
"`--padding_free` argument was called with `packing=True`, "
168168
"Trainer should not perform packing when using `--padding_free`"
169169
)
170+
except_modules = False
170171
if fast_moe_config is not None and fast_moe_config.fast_moe is None:
171172
fast_moe_config = None
172173
if fast_moe_config is not None:
@@ -177,7 +178,7 @@ def train(
177178
and hasattr(peft_config, "target_modules")
178179
and fast_moe_config.fast_moe is not None
179180
):
180-
peft_config.exclude_modules = "router"
181+
except_modules = True
181182
logger.warning(
182183
"You are running lora with the ScatterMoE plugin, please note that "
183184
"passing target modules that are part of the moe module can cause unexpected "
@@ -315,6 +316,9 @@ def train(
315316
),
316317
)
317318

319+
if except_modules:
320+
peft_config.exclude_modules = "router"
321+
318322
if data_args.chat_template:
319323
# TODO: passing "/n" through cli causes parsing issues,
320324
# hence providing a temporary fix

0 commit comments

Comments
 (0)