Skip to content

Commit

Permalink
chore: update outlines function call to new name
Browse files Browse the repository at this point in the history
this is introduces since version 0.32
with this pull request
dottxt-ai/outlines#556
It changes the function name from
`build_regex_from_object` to `build_regex_from_schema`
This leads to an error in newer docker containers when starting
tgi.
  • Loading branch information
joennlae committed Mar 19, 2024
1 parent 0d72af5 commit a122582
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ peft = { version = "^0.9.0", optional = true }
torch = { version = "^2.1.1", optional = true }
scipy = "^1.11.1"
pillow = "^10.0.0"
outlines= { version = "^0.0.27", optional = true }
outlines= { version = "^0.0.32", optional = true }

[tool.poetry.extras]
torch = ["torch"]
Expand Down
4 changes: 2 additions & 2 deletions server/text_generation_server/utils/logits_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from text_generation_server.pb.generate_pb2 import GrammarType

from outlines.fsm.fsm import RegexFSM
from outlines.fsm.json_schema import build_regex_from_object
from outlines.fsm.json_schema import build_regex_from_schema
from functools import lru_cache
from typing import List, Optional, DefaultDict
import time
Expand Down Expand Up @@ -512,7 +512,7 @@ def _advance(next_token_id, fsm_grammar_state, fsm):
def _cached_compile_fsm(grammar_type, schema, tokenizer):
start_time = time.time()
if grammar_type == GrammarType.GRAMMAR_TYPE_JSON:
schema = build_regex_from_object(schema)
schema = build_regex_from_schema(schema)
elif grammar_type == GrammarType.GRAMMAR_TYPE_REGEX:
pass # schema is already a regex just here for clarity
fsm = RegexFSM(schema, tokenizer)
Expand Down

0 comments on commit a122582

Please sign in to comment.