tiny fix
Former-commit-id: bb57478366a70a0871af30ab31c890f471e27ff4
This commit is contained in:
@@ -216,7 +216,7 @@ class ToolFormatter(Formatter):
|
||||
self._tool_formatter = glm4_tool_formatter
|
||||
self._tool_extractor = glm4_tool_extractor
|
||||
else:
|
||||
raise ValueError("Tool format was not found.")
|
||||
raise NotImplementedError("Tool format {} was not found.".format(self.tool_format))
|
||||
|
||||
def apply(self, **kwargs) -> SLOTS:
|
||||
content = kwargs.pop("content")
|
||||
|
||||
@@ -387,8 +387,9 @@ def get_template_and_fix_tokenizer(
|
||||
template = TEMPLATES.get(name, None)
|
||||
if template is None:
|
||||
raise ValueError("Template {} does not exist.".format(name))
|
||||
|
||||
if tool_format:
|
||||
|
||||
if tool_format is not None:
|
||||
logger.info("Using tool format: {}.".format(tool_format))
|
||||
template.format_tools = ToolFormatter(tool_format=tool_format)
|
||||
|
||||
stop_words = template.stop_words
|
||||
@@ -625,7 +626,6 @@ _register_template(
|
||||
|
||||
_register_template(
|
||||
name="empty",
|
||||
format_prefix=EmptyFormatter(slots=[{"bos_token"}]),
|
||||
efficient_eos=True,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user