Merge pull request #5922 from Tuyohai/main

support granite3 models

Former-commit-id: a9087bc0549f7f16e5b4c39e324043755b1618c8
This commit is contained in:
hoshi-hiyouga
2024-12-23 16:46:02 +08:00
committed by GitHub
4 changed files with 53 additions and 0 deletions

View File

@@ -696,6 +696,18 @@ _register_template(
)
_register_template(
name="granite3",
format_user=StringFormatter(slots=["<|start_of_role|>user<|end_of_role|>{{content}}<|end_of_text|>\n<|start_of_role|>assistant<|end_of_role|>"]),
format_system=StringFormatter(slots=["<|start_of_role|>system<|end_of_role|>{{content}}<|end_of_text|>\n"]),
format_assistant=StringFormatter(slots=["{{content}}<|end_of_text|>\n"]),
format_separator=EmptyFormatter(slots=["\n"]),
stop_words=["<|end_of_text|>"],
replace_eos=True,
replace_jinja_template=True,
)
_register_template(
name="index",
format_user=StringFormatter(slots=["reserved_0{{content}}reserved_1"]),