From 4ed2b629a51ef58d229c795e85238d40346ecb58 Mon Sep 17 00:00:00 2001 From: menibrief <66391712+menibrief@users.noreply.github.com> Date: Wed, 18 Sep 2024 23:52:30 +0300 Subject: [PATCH] fix phi-small template Former-commit-id: 9c1bbfac2173450c56ded2cf343e3a37ba369b7b --- src/llamafactory/data/template.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/llamafactory/data/template.py b/src/llamafactory/data/template.py index 54da4757..9490b6af 100644 --- a/src/llamafactory/data/template.py +++ b/src/llamafactory/data/template.py @@ -821,6 +821,15 @@ _register_template( replace_eos=True, ) +_register_template( + name="phi-small", + format_user=StringFormatter(slots=["<|user|>\n{{content}}<|end|>\n<|assistant|>\n"]), + format_system=StringFormatter(slots=["<|system|>\n{{content}}<|end|>\n"]), + format_separator=EmptyFormatter(slots=["\n"]), + format_prefix=EmptyFormatter(slots=[{"<|endoftext|>"}]), + stop_words=["<|end|>"], + replace_eos=True, +) _register_template( name="qwen",