[misc] fix constants (#9008)
This commit is contained in:
@@ -98,7 +98,7 @@ class FunctionFormatter(StringFormatter):
|
||||
def apply(self, **kwargs) -> SLOTS:
|
||||
content: str = kwargs.pop("content")
|
||||
thought_words, thought = kwargs.pop("thought_words", None), None
|
||||
if thought_words and len(thought_words)== 2:
|
||||
if thought_words and len(thought_words) == 2:
|
||||
regex = re.compile(rf"{re.escape(thought_words[0])}(.*?){re.escape(thought_words[1])}", re.DOTALL)
|
||||
thought = re.search(regex, content)
|
||||
|
||||
|
||||
@@ -1855,19 +1855,17 @@ register_template(
|
||||
)
|
||||
|
||||
|
||||
#copied from seed_coder
|
||||
# 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_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>")
|
||||
thought_words=("<seed:think>", "</seed:think>"),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -355,6 +355,7 @@ class GLM4MOEToolUtils(QwenToolUtils):
|
||||
|
||||
return "\n".join(function_texts)
|
||||
|
||||
|
||||
class SeedToolUtils(ToolUtils):
|
||||
r"""Seed tool using template."""
|
||||
|
||||
@@ -387,8 +388,7 @@ class SeedToolUtils(ToolUtils):
|
||||
def tool_extractor(content: str) -> Union[str, list["FunctionCall"]]:
|
||||
results = []
|
||||
regex = re.compile(
|
||||
r"<seed:tool_call>\s*<function=\s*([^\s<]+)\s*(.*?)\s*</function>\s*</seed:tool_call>",
|
||||
re.DOTALL
|
||||
r"<seed:tool_call>\s*<function=\s*([^\s<]+)\s*(.*?)\s*</function>\s*</seed:tool_call>", re.DOTALL
|
||||
)
|
||||
for func_name, params_block in re.findall(regex, content):
|
||||
args_dict = {}
|
||||
@@ -405,6 +405,7 @@ class SeedToolUtils(ToolUtils):
|
||||
|
||||
return results
|
||||
|
||||
|
||||
TOOLS = {
|
||||
"default": DefaultToolUtils(),
|
||||
"glm4": GLM4ToolUtils(),
|
||||
|
||||
@@ -645,6 +645,7 @@ register_model_group(
|
||||
template="falcon",
|
||||
)
|
||||
|
||||
|
||||
register_model_group(
|
||||
models={
|
||||
"Falcon-H1-0.5B-Base": {
|
||||
@@ -1264,6 +1265,7 @@ register_model_group(
|
||||
multimodal=True,
|
||||
)
|
||||
|
||||
|
||||
register_model_group(
|
||||
models={
|
||||
"Intern-S1-mini": {
|
||||
@@ -1275,6 +1277,7 @@ register_model_group(
|
||||
multimodal=True,
|
||||
)
|
||||
|
||||
|
||||
register_model_group(
|
||||
models={
|
||||
"Jamba-v0.1": {
|
||||
@@ -3039,18 +3042,40 @@ register_model_group(
|
||||
models={
|
||||
"Seed-Coder-8B-Base": {
|
||||
DownloadSource.DEFAULT: "ByteDance-Seed/Seed-Coder-8B-Base",
|
||||
DownloadSource.MODELSCOPE: "ByteDance-Seed/Seed-Coder-8B-Base",
|
||||
},
|
||||
"Seed-Coder-8B-Instruct": {
|
||||
DownloadSource.DEFAULT: "ByteDance-Seed/Seed-Coder-8B-Instruct",
|
||||
DownloadSource.MODELSCOPE: "ByteDance-Seed/Seed-Coder-8B-Instruct",
|
||||
},
|
||||
"Seed-Coder-8B-Instruct-Reasoning": {
|
||||
"Seed-Coder-8B-Thinking": {
|
||||
DownloadSource.DEFAULT: "ByteDance-Seed/Seed-Coder-8B-Reasoning-bf16",
|
||||
DownloadSource.MODELSCOPE: "ByteDance-Seed/Seed-Coder-8B-Reasoning-bf16",
|
||||
},
|
||||
},
|
||||
template="seed_coder",
|
||||
)
|
||||
|
||||
|
||||
register_model_group(
|
||||
models={
|
||||
"Seed-OSS-36B-Base": {
|
||||
DownloadSource.DEFAULT: "ByteDance-Seed/Seed-OSS-36B-Base",
|
||||
DownloadSource.MODELSCOPE: "ByteDance-Seed/Seed-OSS-36B-Base",
|
||||
},
|
||||
"Seed-OSS-36B-Base-woSyn": {
|
||||
DownloadSource.DEFAULT: "ByteDance-Seed/Seed-OSS-36B-Base-woSyn",
|
||||
DownloadSource.MODELSCOPE: "ByteDance-Seed/Seed-OSS-36B-Base-woSyn",
|
||||
},
|
||||
"Seed-OSS-36B-Instruct": {
|
||||
DownloadSource.DEFAULT: "ByteDance-Seed/Seed-OSS-36B-Instruct",
|
||||
DownloadSource.MODELSCOPE: "ByteDance-Seed/Seed-OSS-36B-Instruct",
|
||||
},
|
||||
},
|
||||
template="seed_oss",
|
||||
)
|
||||
|
||||
|
||||
register_model_group(
|
||||
models={
|
||||
"Skywork-13B-Base": {
|
||||
|
||||
Reference in New Issue
Block a user