@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 1140991a7b
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 15, 19:45 UTC

[V1] Fix vocab size calculation for structured output (#14826)

Signed-off-by: Russell Bryant <rbryant@redhat.com>

Russell Bryant committed Mar 14, 2025 at 12:18 UTC 1140991a7b3a435b06fb819b683cc12780a19e52
1 file changed +1 -1
vllm/v1/structured_output/__init__.py
+1 -1
@@ -40,7 +40,7 @@ class StructuredOutputManager:
40 tokenizer_group.ping()
41
42 tokenizer = tokenizer_group.get_lora_tokenizer(None)
43 - self.vocab_size = tokenizer.max_token_id
43 + self.vocab_size = tokenizer.max_token_id + 1
44 if isinstance(tokenizer, MistralTokenizer):
45 # NOTE: ideally, xgrammar should handle this accordingly.
46 # refer to https://github.com/mlc-ai/xgrammar/blob/d77c0a0173ef14779c918e3be7966ba852f7910f/python/xgrammar/tokenizer_info.py#L98