[data] bailing template v2 & openai data converter (#9112)

This commit is contained in:
wangshaofei
2025-09-14 02:20:34 +08:00
committed by GitHub
parent db223e3975
commit a22dab97fd
3 changed files with 182 additions and 1 deletions

View File

@@ -679,6 +679,21 @@ register_template(
)
register_template(
name="bailing_v2",
format_user=StringFormatter(slots=["<role>HUMAN</role>{{content}}<|role_end|><role>ASSISTANT</role>"]),
format_system=StringFormatter(slots=["<role>SYSTEM</role>{{content}}<|role_end|>"]),
format_assistant=StringFormatter(slots=["{{content}}<|role_end|>"]),
format_observation=StringFormatter(
slots=["<role>OBSERVATION</role>\n<tool_response>\n{{content}}\n</tool_response><|role_end|><role>ASSISTANT</role>"]
),
format_function=FunctionFormatter(slots=["{{content}}<|role_end|>"], tool_format="ling"),
format_tools=ToolFormatter(tool_format="ling"),
stop_words=["<|endoftext|>"],
efficient_eos=True,
)
register_template(
name="belle",
format_user=StringFormatter(slots=["Human: {{content}}\n\nBelle: "]),