Unverified Commit 32a4141d authored by Enrique Shockwave's avatar Enrique Shockwave Committed by GitHub
Browse files

Allow new lines during JSON generation (#1277)

parent 08360553
...@@ -79,7 +79,7 @@ class FSMCache(BaseToolCache): ...@@ -79,7 +79,7 @@ class FSMCache(BaseToolCache):
def init_value(self, value): def init_value(self, value):
if self.json_schema_mode: 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 return RegexGuide(regex, self.outlines_tokenizer), regex
else: else:
return RegexGuide(value, self.outlines_tokenizer) return RegexGuide(value, self.outlines_tokenizer)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment