[V1] Add disable-any-whitespace option support for xgrammar (#15316)

Signed-off-by: Russell Bryant <rbryant@redhat.com>
This commit is contained in:
Russell Bryant
2025-03-22 11:56:17 -04:00
committed by GitHub
parent 2f4bd358f1
commit eb63ea1e18
4 changed files with 53 additions and 5 deletions

View File

@@ -120,7 +120,7 @@ class Processor:
if not params.guided_decoding or not self.decoding_config:
return
supported_backends = ["xgrammar"]
supported_backends = ["xgrammar", "xgrammar:disable-any-whitespace"]
engine_level_backend = self.decoding_config.guided_decoding_backend
if engine_level_backend not in supported_backends:
raise ValueError(f"Only {supported_backends} structured output is "