mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-12-15 11:20:35 +08:00
enable cutoff len
This commit is contained in:
@@ -93,6 +93,9 @@ class ToolFormatter:
|
||||
def __call__(self, content: str) -> List[Union[str, Dict[str, str]]]:
|
||||
try:
|
||||
tools = json.loads(content)
|
||||
if not len(tools):
|
||||
return [""]
|
||||
|
||||
if self.type == "default":
|
||||
return [self._default(tools)]
|
||||
except json.JSONDecodeError:
|
||||
|
||||
Reference in New Issue
Block a user