support telechat2 model

Former-commit-id: 15a069d85c07842cd28d65845af93c3cf70ef1f4
This commit is contained in:
zhaohu xing
2024-12-12 09:40:00 +08:00
committed by hiyouga
parent 101c95ce65
commit 584755be4b
4 changed files with 58 additions and 6 deletions

View File

@@ -1131,8 +1131,17 @@ _register_template(
name="telechat",
format_user=StringFormatter(slots=["<_user>{{content}}<_bot>"]),
format_system=StringFormatter(slots=["<_system>{{content}}<_end>"]),
stop_words=["<_end>"],
replace_eos=True,
)
_register_template(
name="telechat2",
format_user=StringFormatter(slots=["<_user>{{content}}<_bot>"]),
format_system=StringFormatter(slots=["<_system>{{content}}"]),
default_system=(
"你是中国电信星辰语义大模型英文名是TeleChat你是由中电信人工智能科技有限公司和中国电信人工智能研究院TeleAI研发的人工智能助手。"
),
replace_jinja_template=False,
)