Support glm4.1v and glm4.5v (#8798)
Signed-off-by: Xinyuan Tong <justinning0323@outlook.com> Signed-off-by: Xinyuan Tong <xinyuantong.cs@gmail.com> Co-authored-by: Xinyuan Tong <justinning0323@outlook.com> Co-authored-by: Xinyuan Tong <115166877+JustinTong0323@users.noreply.github.com> Co-authored-by: Xinyuan Tong <xinyuantong.cs@gmail.com> Co-authored-by: zRzRzRzRzRzRzR <2448370773@qq.com> Co-authored-by: Minglei Zhu <mingleizhu1122@gmail.com> Co-authored-by: Chang Su <csu272@usc.edu>
This commit is contained in:
@@ -316,6 +316,7 @@ class EBNFComposer:
|
||||
|
||||
combined_args = "".join(rule_parts)
|
||||
arguments_rule = args_template.format(arg_rules=combined_args)
|
||||
arguments_rule = arguments_rule or '""'
|
||||
|
||||
# Add the function call rule and its arguments rule
|
||||
ebnf_lines.append(
|
||||
|
||||
@@ -158,7 +158,7 @@ class Glm4MoeDetector(BaseFormatDetector):
|
||||
individual_call_end_token=self.eot_token,
|
||||
tool_call_separator="\\n",
|
||||
function_format="xml",
|
||||
call_rule_fmt='"{name}" "\\n" {arguments_rule} "\\n"',
|
||||
call_rule_fmt='"{name}" "\\n" ( {arguments_rule} "\\n" )?',
|
||||
key_value_rule_fmt='"<arg_key>{key}</arg_key>" "\\n" "<arg_value>" {valrule} "</arg_value>"',
|
||||
key_value_separator="\\n",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user