Fix tiny misalign with previous truncation setting in tokenizer_manager (#9430)

This commit is contained in:
Liangsheng Yin
2025-08-21 14:05:35 +08:00
committed by GitHub
parent 70bb066ee4
commit 9b5f0f64f5

View File

@@ -566,7 +566,7 @@ class TokenizerManager:
) -> None: ) -> None:
"""Validates that the input token count and the requested token count doesn't exceed the model's context length.""" """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. # 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 input_token_num = len(input_ids) if input_ids is not None else 0
if input_token_num >= self.context_len: if input_token_num >= self.context_len: