[Bugfix][Structured Output] Reject structural_tag and unhandled specs in backend validation (#58862)
Signed-off-by: Samay <samay.piduru@gmail.com> Co-authored-by: Artem Perevedentsev <aperevedents@nvidia.com>
This commit is contained in:
co-authored by
Artem Perevedentsev
parent
7173c64e2e
commit
54db759eea
@@ -198,9 +198,9 @@ def validate_structured_output_request_outlines(params: SamplingParams):
|
||||
|
||||
so_params = params.structured_outputs
|
||||
|
||||
if so_params.regex:
|
||||
if so_params.regex is not None:
|
||||
validate_regex_is_buildable(so_params.regex)
|
||||
elif so_params.json:
|
||||
elif so_params.json is not None:
|
||||
if isinstance(so_params.json, str):
|
||||
try:
|
||||
# make sure schema is valid json
|
||||
@@ -236,6 +236,16 @@ def validate_structured_output_request_outlines(params: SamplingParams):
|
||||
"Outlines structured outputs backend "
|
||||
"does not support grammar specifications"
|
||||
)
|
||||
elif so_params.structural_tag:
|
||||
raise VLLMValidationError(
|
||||
"Outlines structured outputs backend "
|
||||
"does not support structural_tag specifications"
|
||||
)
|
||||
else:
|
||||
raise VLLMValidationError(
|
||||
"Outlines structured outputs backend "
|
||||
"does not support this structured outputs specification"
|
||||
)
|
||||
|
||||
|
||||
def _prefix_needs_context(parsed) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user