[Build] Update Xgrammar to 0.1.25 (#25467)

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
Chauncey 2025-09-24 05:25:46 +08:00 committed by yewentao256
parent d8fda7420a
commit 0438c65376
2 changed files with 7 additions and 3 deletions

View File

@ -24,7 +24,7 @@ outlines_core == 0.2.11
# required for outlines backend disk cache
diskcache == 5.6.3
lark == 1.2.2
xgrammar == 0.1.24; platform_machine == "x86_64" or platform_machine == "aarch64" or platform_machine == "arm64"
xgrammar == 0.1.25; platform_machine == "x86_64" or platform_machine == "aarch64" or platform_machine == "arm64"
typing_extensions >= 4.10
filelock >= 3.16.1 # need to contain https://github.com/tox-dev/filelock/pull/317
partial-json-parser # used for parsing partial JSON outputs

View File

@ -108,7 +108,9 @@ class XgrammarBackend(StructuredOutputBackend):
end=s["end"],
) for s in s_tag["structures"]
]
ctx = self.compiler.compile_structural_tag(tags, s_tag["triggers"])
structural_tag = xgr.StructuralTag.from_legacy_structural_tag(
tags, s_tag["triggers"])
ctx = self.compiler.compile_structural_tag(structural_tag)
else:
logger.error(
"Validation should have already occurred. Please file an issue."
@ -318,6 +320,8 @@ def validate_xgrammar_grammar(sampling_params: SamplingParams) -> None:
end=s["end"],
) for s in s_tag["structures"]
]
xgr.Grammar.from_structural_tag(tags, s_tag["triggers"])
structural_tag = xgr.StructuralTag.from_legacy_structural_tag(
tags, s_tag["triggers"])
xgr.Grammar.from_structural_tag(structural_tag)
except Exception as e:
raise ValueError("Invalid structural tag specification.") from e