Skip to content

Commit

Permalink
Fix json processor
Browse files Browse the repository at this point in the history
  • Loading branch information
dtiarks committed Feb 13, 2024
1 parent c5998f8 commit a7e14e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions outlines/generate/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from numpy.typing import NDArray

from outlines.fsm.fsm import CFGFSM, FSM, FSMState, RegexFSM
from outlines.fsm.json_schema import build_regex_from_object
from outlines.fsm.json_schema import build_regex_from_schema
from outlines.models.tokenizer import Tokenizer


Expand Down Expand Up @@ -80,7 +80,7 @@ def __init__(self, schema: Union[str, dict], tokenizer: Tokenizer):
# TODO: Why is this needed? We are using regexes
if isinstance(schema, dict):
schema = json.dumps(schema)
regex_string = build_regex_from_object(schema)
regex_string = build_regex_from_schema(schema)
super().__init__(regex_string, tokenizer)


Expand Down

0 comments on commit a7e14e0

Please sign in to comment.