Skip to content

Commit fc95521

Browse files
authored
[Misc] Throw error on unintended access to scheduler_config.max_model_len (#29771)
Signed-off-by: Wei Wei <wwei6@meta.com>
1 parent d0cd728 commit fc95521

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

vllm/config/scheduler.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,3 +274,8 @@ def verify_max_model_len(self, max_model_len: int) -> Self:
274274
)
275275

276276
return self
277+
278+
def __getattribute__(self, name: str) -> Any:
279+
if name == "max_model_len" or name == "is_encoder_decoder":
280+
raise AttributeError(f"{name} is an init-only parameter. ")
281+
return object.__getattribute__(self, name)

0 commit comments

Comments
 (0)