Skip to content

Commit

Permalink
bugfix: exclude null types in anyOf list
Browse files Browse the repository at this point in the history
  • Loading branch information
leloykun committed May 4, 2024
1 parent 1a2e5a0 commit 0a4b076
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion outlines/fsm/json_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def optimize_schema(instance):
elif "anyOf" in subinstance and _has_null_type(subinstance["anyOf"]):
any_of_list = subinstance.pop("anyOf")
filtered_any_of_list = list(
filter(lambda d: _is_null_type(d), any_of_list)
filter(lambda d: not _is_null_type(d), any_of_list)
)
if len(filtered_any_of_list) == 0:
keys_to_remove.add(key)
Expand Down

0 comments on commit 0a4b076

Please sign in to comment.