mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-12-19 13:20:36 +08:00
[model] support Seed-OSS (#8992)
Co-authored-by: Yaowei Zheng <hiyouga@buaa.edu.cn>
This commit is contained in:
@@ -156,7 +156,7 @@ class Template:
|
||||
elif message["role"] == Role.OBSERVATION:
|
||||
elements += self.format_observation.apply(content=message["content"])
|
||||
elif message["role"] == Role.FUNCTION:
|
||||
elements += self.format_function.apply(content=message["content"])
|
||||
elements += self.format_function.apply(content=message["content"], thought_words=self.thought_words)
|
||||
else:
|
||||
raise NotImplementedError("Unexpected role: {}".format(message["role"]))
|
||||
|
||||
@@ -1855,6 +1855,22 @@ register_template(
|
||||
)
|
||||
|
||||
|
||||
#copied from seed_coder
|
||||
register_template(
|
||||
name="seed_oss",
|
||||
format_user=StringFormatter(
|
||||
slots=[{"bos_token"}, "user\n{{content}}", {"eos_token"}, {"bos_token"}, "assistant\n"]
|
||||
),
|
||||
format_system=StringFormatter(slots=[{"bos_token"}, "system\n{{content}}", {"eos_token"}]),
|
||||
format_function=FunctionFormatter(
|
||||
slots=[{"bos_token"}, "\n{{content}}", {"eos_token"}], tool_format="seed_oss"
|
||||
),
|
||||
format_tools=ToolFormatter(tool_format="seed_oss"),
|
||||
template_class=ReasoningTemplate,
|
||||
thought_words=("<seed:think>", "</seed:think>")
|
||||
)
|
||||
|
||||
|
||||
# copied from llama3 template
|
||||
register_template(
|
||||
name="skywork_o1",
|
||||
|
||||
Reference in New Issue
Block a user