[Bugfix] Fix max_model_len="auto" handling (#31260)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2025-12-24 19:15:27 +08:00
committed by GitHub
parent bd89ce16d2
commit 7adeb4bfa8
3 changed files with 79 additions and 82 deletions
+1 -1
View File
@@ -164,7 +164,7 @@ class ModelConfig:
"""The specific revision to use for the tokenizer on the Hugging Face Hub.
It can be a branch name, a tag name, or a commit id. If unspecified, will
use the default version."""
max_model_len: int = Field(default=None, gt=0)
max_model_len: int = Field(default=None, ge=-1)
"""Model context length (prompt and output). If unspecified, will be
automatically derived from the model config.