Former-commit-id: 81176fe226da89eace89cb202bad68e73b7c2a02
This commit is contained in:
fzc8578
2025-01-04 11:11:15 +08:00
parent 5504b5254c
commit 2c120aa0df
7 changed files with 164 additions and 2 deletions

View File

@@ -583,6 +583,22 @@ _register_template(
)
_register_template(
name="cpm_o",
format_user=StringFormatter(slots=["<|im_start|>user\n{{content}}<|im_end|>\n<|im_start|>assistant\n"]),
format_system=StringFormatter(slots=["<|im_start|>system\n{{content}}<|im_end|>\n"]),
format_function=FunctionFormatter(slots=["{{content}}", "<|im_end|>"], tool_format="qwen"),
format_observation=StringFormatter(
slots=["<|im_start|>user\n<tool_response>\n{{content}}\n</tool_response><|im_end|>\n<|im_start|>assistant\n"]
),
format_tools=ToolFormatter(tool_format="qwen"),
format_separator=EmptyFormatter(slots=["\n"]),
default_system="You are a helpful assistant.",
stop_words=["<|im_end|>"],
mm_plugin=get_mm_plugin(name="cpm_o", image_token="<image>", video_token="<video>"),
)
# copied from chatml template
_register_template(
name="dbrx",