Skip to content

Commit b8225d7

Browse files
Jason-CKYmzusman
authored andcommitted
[bugfix] catch xgrammar unsupported array constraints (vllm-project#12210)
Signed-off-by: Jason Cheng <[email protected]>
1 parent d026306 commit b8225d7

File tree

1 file changed

+7
-0
lines changed
  • vllm/model_executor/guided_decoding

1 file changed

+7
-0
lines changed

vllm/model_executor/guided_decoding/utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ def check_object(obj: dict) -> bool:
2020
]):
2121
return True
2222

23+
# Check for array unsupported keywords
24+
if obj.get("type") == "array" and any(key in obj for key in [
25+
"uniqueItems", "contains", "minContains", "maxContains",
26+
"minItems", "maxItems"
27+
]):
28+
return True
29+
2330
# Recursively check all nested objects and arrays
2431
for value in obj.values():
2532
if isinstance(value, dict):

0 commit comments

Comments
 (0)