From ee059c393baecc4a4dfd44171d24cab45c73c962 Mon Sep 17 00:00:00 2001 From: "huangpan.foo" Date: Sat, 21 Sep 2024 19:33:30 +0800 Subject: [PATCH] Add deepseek-v2.5 template --- src/llamafactory/data/template.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/llamafactory/data/template.py b/src/llamafactory/data/template.py index 54da4757f7..01985801f6 100644 --- a/src/llamafactory/data/template.py +++ b/src/llamafactory/data/template.py @@ -611,6 +611,14 @@ def get_template_and_fix_tokenizer(tokenizer: "PreTrainedTokenizer", data_args: ) +_register_template( + name="deepseek_v2.5", + format_user=StringFormatter(slots=["<|User|>{{content}}<|Assistant|>"]), + format_system=StringFormatter(slots=["{{content}}"]), + format_prefix=EmptyFormatter(slots=[{"bos_token"}]), +) + + _register_template( name="deepseekcoder", format_user=StringFormatter(slots=["### Instruction:\n{{content}}\n### Response:"]),