"vscode:/vscode.git/clone" did not exist on "d0feea31c70f9540a8993c4e96103a03cd935416"
Unverified Commit f7197722 authored by Michael Goin's avatar Michael Goin Committed by GitHub
Browse files

[Bugfix] Properly reject requests with empty list guided_choice (#20195)


Signed-off-by: default avatarmgoin <mgoin64@gmail.com>
parent d45417b8
......@@ -173,6 +173,12 @@ class Processor:
params.guided_decoding.backend = engine_level_backend
# Request content validation
if (isinstance(params.guided_decoding.choice, list)
and not params.guided_decoding.choice):
# It is invalid for choice to be an empty list
raise ValueError(f"Choice '{params.guided_decoding.choice}' "
"cannot be an empty list")
if engine_level_backend.startswith("xgrammar"):
# xgrammar with no fallback
validate_xgrammar_grammar(params)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment