From 12f852b8d42b1b1f5293278c5b8862c13c446369 Mon Sep 17 00:00:00 2001 From: hoshi-hiyouga Date: Wed, 24 Apr 2024 13:55:14 +0800 Subject: [PATCH] fix phi template Former-commit-id: 14a1ff665eaebfc618229efbe96f09848d52faec --- src/llmtuner/data/template.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/llmtuner/data/template.py b/src/llmtuner/data/template.py index efdd44f3..dd355e97 100644 --- a/src/llmtuner/data/template.py +++ b/src/llmtuner/data/template.py @@ -747,8 +747,10 @@ _register_template( name="phi", format_user=StringFormatter(slots=["<|user|>\n{{content}}<|end|>\n<|assistant|>\n"]), format_system=StringFormatter(slots=[{"bos_token"}, "<|system|>\n{{content}}<|end|>\n"]), - format_separator=EmptyFormatter(slots=["<|end|>\n"]), + format_separator=EmptyFormatter(slots=["\n"]), default_system="You are a helpful AI assistant.", + stop_words=["<|end|>"], + replace_eos=True, )