From d3bef03dc68b8ce030207671d20ebeba89e2cd3b Mon Sep 17 00:00:00 2001 From: hiyouga Date: Mon, 21 Aug 2023 17:41:51 +0800 Subject: [PATCH] fix baichuan template for training #597 #616 Former-commit-id: 0a3f6984259526775b0efdb8a1b0b24f564a7239 --- src/llmtuner/extras/template.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/llmtuner/extras/template.py b/src/llmtuner/extras/template.py index 5d5a03fb..c4cdb70a 100644 --- a/src/llmtuner/extras/template.py +++ b/src/llmtuner/extras/template.py @@ -472,9 +472,30 @@ register_template( r""" Supports: https://huggingface.co/baichuan-inc/Baichuan-13B-Chat +Used for training. """ register_template( name="baichuan", + prefix=[ + "{{system}}" + ], + prompt=[ + {"token": ""}, # user token + "{{query}}", + {"token": ""} # assistant token + ], + system="", + sep=[], + stop_words=[] +) + + +r""" +Supports: https://huggingface.co/baichuan-inc/Baichuan-13B-Chat +Used for inference of the original model. +""" +register_template( + name="baichuan_eval", prefix=[ "{{system}}", {"token": ""} # user token