Skip to content

Commit

Permalink
Make `generate.json()ˋ work with json schema strings
Browse files Browse the repository at this point in the history
  • Loading branch information
bettybas committed Nov 29, 2023
1 parent 77378d6 commit 12392f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion outlines/text/generate/regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ def json(
# TODO: Convert string fields to their respective types
format_fn = lambda x: pyjson.loads(x)
else:
format_fn = lambda x: x
schema = schema_object
format_fn = lambda x: pyjson.loads(x)

regex_str = build_regex_from_object(schema)

Expand Down

0 comments on commit 12392f2

Please sign in to comment.