Skip to content

Commit 08275ec

Browse files
[Build] Update Xgrammar to 0.1.25 (#25467)
Signed-off-by: chaunceyjiang <[email protected]>
1 parent c828d1b commit 08275ec

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

requirements/common.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ outlines_core == 0.2.11
2424
# required for outlines backend disk cache
2525
diskcache == 5.6.3
2626
lark == 1.2.2
27-
xgrammar == 0.1.24; platform_machine == "x86_64" or platform_machine == "aarch64" or platform_machine == "arm64"
27+
xgrammar == 0.1.25; platform_machine == "x86_64" or platform_machine == "aarch64" or platform_machine == "arm64"
2828
typing_extensions >= 4.10
2929
filelock >= 3.16.1 # need to contain https://github.com/tox-dev/filelock/pull/317
3030
partial-json-parser # used for parsing partial JSON outputs

vllm/v1/structured_output/backend_xgrammar.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ def compile_grammar(self, request_type: StructuredOutputOptions,
108108
end=s["end"],
109109
) for s in s_tag["structures"]
110110
]
111-
ctx = self.compiler.compile_structural_tag(tags, s_tag["triggers"])
111+
structural_tag = xgr.StructuralTag.from_legacy_structural_tag(
112+
tags, s_tag["triggers"])
113+
ctx = self.compiler.compile_structural_tag(structural_tag)
112114
else:
113115
logger.error(
114116
"Validation should have already occurred. Please file an issue."
@@ -318,6 +320,8 @@ def validate_xgrammar_grammar(sampling_params: SamplingParams) -> None:
318320
end=s["end"],
319321
) for s in s_tag["structures"]
320322
]
321-
xgr.Grammar.from_structural_tag(tags, s_tag["triggers"])
323+
structural_tag = xgr.StructuralTag.from_legacy_structural_tag(
324+
tags, s_tag["triggers"])
325+
xgr.Grammar.from_structural_tag(structural_tag)
322326
except Exception as e:
323327
raise ValueError("Invalid structural tag specification.") from e

0 commit comments

Comments
 (0)