@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / bb6d8c21f9
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 14, 05:30 UTC

[Bugfix] Catch and log invalid token ids in detokenizer #2 (#26445)

Signed-off-by: Nick Hill <nhill@redhat.com>

Nick Hill committed Oct 8, 2025 at 21:20 UTC bb6d8c21f9bcc9e333165b81ee99975c64d9ae1d
1 file changed +2 -2
vllm/v1/engine/detokenizer.py
+2 -2
@@ -227,10 +227,10 @@ class FastIncrementalDetokenizer(BaseIncrementalDetokenizer):
227 def _protected_step(self, next_token_id: int) -> Optional[str]:
228 try:
229 token = self.stream.step(self.tokenizer, next_token_id)
230 - except OverflowError:
230 + except (OverflowError, TypeError):
231 # Handle rare observed overflow, still to be diagnosed.
232 # See https://github.com/vllm-project/vllm/issues/21951.
233 - logger.exception("Encountered invalid token id: %d", next_token_id)
233 + logger.exception("Encountered invalid token id: %r", next_token_id)
234 token = None
235 except Exception as e:
236 if not str(e).startswith(INVALID_PREFIX_ERR_MSG):