From 9b5f0f64f52033f5965d5b593df5df45c9be8c24 Mon Sep 17 00:00:00 2001 From: Liangsheng Yin Date: Thu, 21 Aug 2025 14:05:35 +0800 Subject: [PATCH] Fix tiny misalign with previous truncation setting in tokenizer_manager (#9430) --- python/sglang/srt/managers/tokenizer_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/sglang/srt/managers/tokenizer_manager.py b/python/sglang/srt/managers/tokenizer_manager.py index f4bda8688..36eb3ddc3 100644 --- a/python/sglang/srt/managers/tokenizer_manager.py +++ b/python/sglang/srt/managers/tokenizer_manager.py @@ -566,7 +566,7 @@ class TokenizerManager: ) -> None: """Validates that the input token count and the requested token count doesn't exceed the model's context length.""" # FIXME: unify the length validation logic with the one in the scheduler. - _max_req_len = self.context_len - 1 + _max_req_len = self.context_len input_token_num = len(input_ids) if input_ids is not None else 0 if input_token_num >= self.context_len: