From de4dc62f716e296ba85d973c436db0aca1c7847d Mon Sep 17 00:00:00 2001 From: Jack Zhang <32371937+jackzhxng@users.noreply.github.com> Date: Tue, 24 Jun 2025 11:03:32 -0700 Subject: [PATCH] Update max context length LlmConfig validation --- examples/models/llama/config/llm_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/models/llama/config/llm_config.py b/examples/models/llama/config/llm_config.py index 72342199dfd..f7428e0db2c 100644 --- a/examples/models/llama/config/llm_config.py +++ b/examples/models/llama/config/llm_config.py @@ -227,9 +227,9 @@ class ExportConfig: export_only: bool = False def __post_init__(self): - if self.max_context_length > self.max_seq_length: + if self.max_context_length < self.max_seq_length: raise ValueError( - f"max_context_length of {self.max_context_length} cannot be greater than max_seq_length of {self.max_seq_length}" + f"max_context_length of {self.max_context_length} cannot be shorter than max_seq_length of {self.max_seq_length}" )