Allow new lines during JSON generation (#1277)

This commit is contained in:
Enrique Shockwave
2024-09-01 03:42:29 -07:00
committed by GitHub
parent 0836055324
commit 32a4141d5a
+1 -1
View File
@@ -79,7 +79,7 @@ class FSMCache(BaseToolCache):
def init_value(self, value):
if self.json_schema_mode:
regex = build_regex_from_schema(value)
regex = build_regex_from_schema(value, whitespace_pattern=r"[\n\t ]*")
return RegexGuide(regex, self.outlines_tokenizer), regex
else:
return RegexGuide(value, self.outlines_tokenizer)