Unverified Commit 08275ec0 authored by Chauncey's avatar Chauncey Committed by GitHub
Browse files

[Build] Update Xgrammar to 0.1.25 (#25467)


Signed-off-by: default avatarchaunceyjiang <chaunceyjiang@gmail.com>
parent c828d1bf
...@@ -24,7 +24,7 @@ outlines_core == 0.2.11 ...@@ -24,7 +24,7 @@ outlines_core == 0.2.11
# required for outlines backend disk cache # required for outlines backend disk cache
diskcache == 5.6.3 diskcache == 5.6.3
lark == 1.2.2 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 typing_extensions >= 4.10
filelock >= 3.16.1 # need to contain https://github.com/tox-dev/filelock/pull/317 filelock >= 3.16.1 # need to contain https://github.com/tox-dev/filelock/pull/317
partial-json-parser # used for parsing partial JSON outputs partial-json-parser # used for parsing partial JSON outputs
......
...@@ -108,7 +108,9 @@ class XgrammarBackend(StructuredOutputBackend): ...@@ -108,7 +108,9 @@ class XgrammarBackend(StructuredOutputBackend):
end=s["end"], end=s["end"],
) for s in s_tag["structures"] ) 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: else:
logger.error( logger.error(
"Validation should have already occurred. Please file an issue." "Validation should have already occurred. Please file an issue."
...@@ -318,6 +320,8 @@ def validate_xgrammar_grammar(sampling_params: SamplingParams) -> None: ...@@ -318,6 +320,8 @@ def validate_xgrammar_grammar(sampling_params: SamplingParams) -> None:
end=s["end"], end=s["end"],
) for s in s_tag["structures"] ) 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: except Exception as e:
raise ValueError("Invalid structural tag specification.") from e raise ValueError("Invalid structural tag specification.") from e
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