From 4e468a3a6128015b3b266b9a100c34926bcb2e01 Mon Sep 17 00:00:00 2001 From: Went-Liang Date: Tue, 29 Oct 2024 22:49:34 +0800 Subject: [PATCH] Fixed bug for from_config_with_defaults Signed-off-by: Went-Liang --- vllm/model_executor/layers/pooler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vllm/model_executor/layers/pooler.py b/vllm/model_executor/layers/pooler.py index f9f627b796320..1c9772b41cbef 100644 --- a/vllm/model_executor/layers/pooler.py +++ b/vllm/model_executor/layers/pooler.py @@ -56,7 +56,9 @@ def from_config_with_defaults( softmax: bool, step_tag_id: Optional[int] = None, returned_token_ids: Optional[List[int]] = None, - ) -> "Pooler": + ) -> Optional["Pooler"]: + if pooler_config is None: + return None return cls( pooling_type=PoolingType[pooler_config.pooling_type] if pooler_config.pooling_type is not None else pooling_type,