Skip to content

Commit 6923b10

Browse files
committed
Chat template
1 parent b554cf7 commit 6923b10

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ local = [
3636
train = [
3737
"squeez[local]",
3838
"datasets>=2.14.0",
39-
"trl>=0.16.0",
39+
"trl>=0.24.0",
4040
"unsloth",
4141
]
4242
all = [

squeez/training/train.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ def train(args: argparse.Namespace):
101101
)
102102
model.print_trainable_parameters()
103103

104+
# Unsloth patches chat_template with <EOS_TOKEN> placeholder — replace with real token
105+
if hasattr(tokenizer, "chat_template") and tokenizer.chat_template:
106+
tokenizer.chat_template = tokenizer.chat_template.replace("<EOS_TOKEN>", "<|im_end|>")
107+
104108
if tokenizer.pad_token is None:
105109
tokenizer.pad_token = tokenizer.eos_token
106110
tokenizer.pad_token_id = tokenizer.eos_token_id

0 commit comments

Comments
 (0)