support llama3

Former-commit-id: c1eabb751a5fd73b710714451b146732e0ed4558
This commit is contained in:
hoshi-hiyouga
2024-04-19 01:13:50 +08:00
parent 9e1bd6420d
commit 8397808d1d
4 changed files with 45 additions and 6 deletions

View File

@@ -649,6 +649,20 @@ _register_template(
)
_register_template(
name="llama3",
format_user=StringFormatter(
slots=[
"<|start_header_id|>user<|end_header_id|>\n\n{{content}}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n"
]
),
format_system=StringFormatter(slots=[{"bos_token"}, "{{content}}"]),
format_separator=EmptyFormatter(slots=["<|eot_id|>"]),
efficient_eos=True,
force_system=True,
)
_register_template(
name="llama2_zh",
format_user=StringFormatter(slots=[{"bos_token"}, "[INST] {{content}} [/INST]"]),