mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-20 04:46:41 +08:00
Reduce validation to a warning (#28749)
Signed-off-by: Alec Solder <alecs@fb.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: Alec Solder <alecs@fb.com> Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
parent
0d8a7d8a26
commit
2c174420f5
@ -65,22 +65,6 @@ class StructuredOutputsConfig:
|
|||||||
|
|
||||||
@model_validator(mode="after")
|
@model_validator(mode="after")
|
||||||
def _validate_structured_output_config(self) -> Self:
|
def _validate_structured_output_config(self) -> Self:
|
||||||
# Import here to avoid circular import
|
|
||||||
from vllm.reasoning.abs_reasoning_parsers import ReasoningParserManager
|
|
||||||
|
|
||||||
if self.reasoning_parser_plugin and len(self.reasoning_parser_plugin) > 3:
|
|
||||||
ReasoningParserManager.import_reasoning_parser(self.reasoning_parser_plugin)
|
|
||||||
|
|
||||||
valid_reasoning_parsers = ReasoningParserManager.list_registered()
|
|
||||||
if (
|
|
||||||
self.reasoning_parser != ""
|
|
||||||
and self.reasoning_parser not in valid_reasoning_parsers
|
|
||||||
):
|
|
||||||
raise ValueError(
|
|
||||||
f"invalid reasoning parser: {self.reasoning_parser} "
|
|
||||||
f"(chose from {{ {','.join(valid_reasoning_parsers)} }})"
|
|
||||||
)
|
|
||||||
|
|
||||||
if self.disable_any_whitespace and self.backend not in ("xgrammar", "guidance"):
|
if self.disable_any_whitespace and self.backend not in ("xgrammar", "guidance"):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"disable_any_whitespace is only supported for "
|
"disable_any_whitespace is only supported for "
|
||||||
|
|||||||
@ -160,7 +160,10 @@ class ReasoningParserManager:
|
|||||||
if name in cls.lazy_parsers:
|
if name in cls.lazy_parsers:
|
||||||
return cls._load_lazy_parser(name)
|
return cls._load_lazy_parser(name)
|
||||||
|
|
||||||
raise KeyError(f"Reasoning parser '{name}' not found.")
|
registered = ", ".join(cls.list_registered())
|
||||||
|
raise KeyError(
|
||||||
|
f"Reasoning parser '{name}' not found. Available parsers: {registered}"
|
||||||
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def list_registered(cls) -> list[str]:
|
def list_registered(cls) -> list[str]:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user