[Build] Update Xgrammar to 0.1.25 (#25467)

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
This commit is contained in:
Chauncey
2025-09-23 21:25:46 +00:00
committed by GitHub
parent c828d1bf98
commit 08275ec0a2
2 changed files with 7 additions and 3 deletions
@@ -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