[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

@@ -1486,7 +1486,9 @@ class EngineArgs:
return False
# Only support Xgrammar for guided decoding so far.
SUPPORTED_GUIDED_DECODING = ["xgrammar", "xgrammar:nofallback"]
SUPPORTED_GUIDED_DECODING = [
"xgrammar", "xgrammar:disable-any-whitespace"
]
if self.guided_decoding_backend not in SUPPORTED_GUIDED_DECODING:
_raise_or_fallback(feature_name="--guided-decoding-backend",
recommend_to_remove=False)