From d0aa36b8ad02287d97930101958456c523e699d3 Mon Sep 17 00:00:00 2001 From: hiyouga <467089858@qq.com> Date: Wed, 29 May 2024 20:58:23 +0800 Subject: [PATCH] fix cohere system --- src/llamafactory/data/template.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/llamafactory/data/template.py b/src/llamafactory/data/template.py index a117b689..00527b44 100644 --- a/src/llamafactory/data/template.py +++ b/src/llamafactory/data/template.py @@ -544,8 +544,13 @@ _register_template( ) ] ), - format_system=StringFormatter(slots=[{"bos_token"}, "{{content}}"]), - force_system=True, + format_system=StringFormatter( + slots=[{"bos_token"}, "<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{content}}<|END_OF_TURN_TOKEN|>"] + ), + default_system=( + "You are Command-R, a brilliant, sophisticated, AI-assistant trained to assist human users " + "by providing thorough responses. You are trained by Cohere." + ), )