mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-12 12:54:52 +00:00
allow silent failure
This commit is contained in:
parent
33cb2cefed
commit
270ec41b09
@ -524,8 +524,9 @@ class GrammarLogitProcessor(LogitsProcessor):
|
|||||||
try:
|
try:
|
||||||
schema = build_regex_from_schema(schema)
|
schema = build_regex_from_schema(schema)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error compiling FSM: {e}")
|
logger.error(f"Error compiling FSM, grammar won't be enforced \n{e}")
|
||||||
return None
|
# allows everything
|
||||||
|
schema = "(.*?)"
|
||||||
elif grammar_type == GrammarType.GRAMMAR_TYPE_REGEX:
|
elif grammar_type == GrammarType.GRAMMAR_TYPE_REGEX:
|
||||||
pass # schema is already a regex just here for clarity
|
pass # schema is already a regex just here for clarity
|
||||||
fsm = RegexFSM(schema, tokenizer)
|
fsm = RegexFSM(schema, tokenizer)
|
||||||
|
Loading…
Reference in New Issue
Block a user