Skip to content

Commit ff86e93

Browse files
committed
update comment and var names
Signed-off-by: Travis Johnson <[email protected]>
1 parent d42efce commit ff86e93

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

vllm/config.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
import vllm.envs as envs
2727
from vllm.compilation.inductor_pass import CallableInductorPass, InductorPass
2828
from vllm.logger import init_logger
29-
from vllm.model_executor.guided_decoding import (SUPPORTED_GUIDED_DECODING_V0,
30-
SUPPORTED_GUIDED_DECODING_V1)
29+
from vllm.model_executor.guided_decoding import (GUIDED_DECODING_BACKENDS_V0,
30+
GUIDED_DECODING_BACKENDS_V1)
3131
from vllm.model_executor.layers.quantization import (QUANTIZATION_METHODS,
3232
get_quantization_config)
3333
from vllm.model_executor.models import ModelRegistry
@@ -2889,7 +2889,6 @@ class DecodingConfig:
28892889
"""Dataclass which contains the decoding strategy of the engine"""
28902890

28912891
# Which guided decoding algo to use.
2892-
# See vllm.model_executor.guided_decoding.SUPPORTED_GUIDED_DECODING
28932892
guided_decoding_backend: str = 'xgrammar'
28942893

28952894
reasoning_backend: Optional[str] = None
@@ -2917,9 +2916,9 @@ def __post_init__(self):
29172916
backend = GuidedDecodingParams(
29182917
backend=self.guided_decoding_backend).backend_name
29192918
if envs.VLLM_USE_V1:
2920-
valid_guided_backends = SUPPORTED_GUIDED_DECODING_V1
2919+
valid_guided_backends = GUIDED_DECODING_BACKENDS_V1
29212920
else:
2922-
valid_guided_backends = SUPPORTED_GUIDED_DECODING_V0
2921+
valid_guided_backends = GUIDED_DECODING_BACKENDS_V0
29232922
if backend not in valid_guided_backends:
29242923
raise ValueError(f"Invalid guided_decoding_backend '{backend}',"
29252924
f" must be one of {valid_guided_backends}")

vllm/engine/arg_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
TokenizerPoolConfig, VllmConfig)
2323
from vllm.executor.executor_base import ExecutorBase
2424
from vllm.logger import init_logger
25-
from vllm.model_executor.guided_decoding import SUPPORTED_GUIDED_DECODING_V1
25+
from vllm.model_executor.guided_decoding import GUIDED_DECODING_BACKENDS_V1
2626
from vllm.model_executor.layers.quantization import QUANTIZATION_METHODS
2727
from vllm.plugins import load_general_plugins
2828
from vllm.reasoning import ReasoningParserManager
@@ -1419,7 +1419,7 @@ def _is_v1_supported_oracle(self, model_config: ModelConfig) -> bool:
14191419

14201420
# remove backend options when doing this check
14211421
if self.guided_decoding_backend.split(':')[0] \
1422-
not in SUPPORTED_GUIDED_DECODING_V1:
1422+
not in GUIDED_DECODING_BACKENDS_V1:
14231423
_raise_or_fallback(
14241424
feature_name=
14251425
f"--guided-decoding-backend={self.guided_decoding_backend}",

vllm/model_executor/guided_decoding/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@
1919

2020
logger = init_logger(__name__)
2121

22-
SUPPORTED_GUIDED_DECODING_V0 = [
22+
GUIDED_DECODING_BACKENDS_V0 = [
2323
"outlines", "lm-format-enforcer", "xgrammar", "guidance"
2424
]
25-
SUPPORTED_GUIDED_DECODING_V1 = ["xgrammar", "guidance", "auto"]
26-
SUPPORTED_GUIDED_DECODING = list(
27-
set(SUPPORTED_GUIDED_DECODING_V0 + SUPPORTED_GUIDED_DECODING_V1))
25+
GUIDED_DECODING_BACKENDS_V1 = ["xgrammar", "guidance", "auto"]
2826

2927

3028
def maybe_backend_fallback(

vllm/model_executor/guided_decoding/guidance_decoding.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ def get_local_guidance_guided_decoding_logits_processor(
2424
any_whitespace = 'disable-any-whitespace' not in \
2525
guided_params.backend_options()
2626
if (guide_json := guided_params.json) is not None:
27-
# Optionally set additionalProperties to False at the top-level
28-
# By default, other backends do not allow additional top-level
29-
# properties, so this makes guidance more similar to other backends
27+
# Optionally set additionalProperties to False by default
28+
# This makes guidance more similar to other supported backends
3029
if 'no-additional-properties' in guided_params.backend_options():
3130
if not isinstance(guide_json, str):
3231
guide_json = json.dumps(guide_json)

0 commit comments

Comments
 (0)