From 279ccc9ddd20094b8ac94e245718d534515ac6b9 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Thu, 21 Nov 2024 21:25:22 +0000 Subject: [PATCH] [Core] Update to outlines >= 0.1.8 0.1.x prior to 0.1.8 + outlines-core 0.1.18 had issues with serialization that broke vllm integration. Also change our code slightly to account for an API change in outlines. Signed-off-by: Russell Bryant --- requirements-common.txt | 2 +- .../guided_decoding/outlines_logits_processors.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-common.txt b/requirements-common.txt index 72fb020a82c4e..6049763d352cc 100644 --- a/requirements-common.txt +++ b/requirements-common.txt @@ -18,7 +18,7 @@ prometheus_client >= 0.18.0 prometheus-fastapi-instrumentator >= 7.0.0 tiktoken >= 0.6.0 # Required for DBRX tokenizer lm-format-enforcer >= 0.10.9, < 0.11 -outlines >= 0.0.43, < 0.1 +outlines >= 0.1.8 xgrammar >= 0.1.5; platform_machine == "x86_64" typing_extensions >= 4.10 filelock >= 3.16.1 # need to contain https://github.com/tox-dev/filelock/pull/317 diff --git a/vllm/model_executor/guided_decoding/outlines_logits_processors.py b/vllm/model_executor/guided_decoding/outlines_logits_processors.py index e1309c31f77e7..1f0dbe024609d 100644 --- a/vllm/model_executor/guided_decoding/outlines_logits_processors.py +++ b/vllm/model_executor/guided_decoding/outlines_logits_processors.py @@ -99,7 +99,7 @@ class RegexLogitsProcessor(BaseLogitsProcessor): def _get_guide(cls, regex_string: str, tokenizer: PreTrainedTokenizerBase) -> Guide: tokenizer = _adapt_tokenizer(tokenizer) - return RegexGuide(regex_string, tokenizer) + return RegexGuide.from_regex(regex_string, tokenizer) def __init__(self, regex_string: str, tokenizer: PreTrainedTokenizerBase): """Compile the FSM that drives the regex-structured generation.