Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions vllm/v1/structured_output/backend_xgrammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ def compile_grammar(self, request_type: StructuredOutputOptions,
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."
Expand Down Expand Up @@ -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
Loading