From 5a4442b3a5eaadee85c48fe911f5323131ce589c Mon Sep 17 00:00:00 2001 From: Harry Mellor <19981378+hmellor@users.noreply.github.com> Date: Mon, 3 Mar 2025 11:55:53 +0100 Subject: [PATCH] Make mypy happy Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> --- vllm/lora/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vllm/lora/utils.py b/vllm/lora/utils.py index 92065f70d1eed..3e9eceb07794d 100644 --- a/vllm/lora/utils.py +++ b/vllm/lora/utils.py @@ -37,7 +37,7 @@ logger = init_logger(__name__) -_all_lora_classes: set[BaseLayerWithLoRA] = { +_all_lora_classes: set[type[BaseLayerWithLoRA]] = { VocabParallelEmbeddingWithLoRA, ColumnParallelLinearWithLoRA, MergedColumnParallelLinearWithLoRA, @@ -68,8 +68,9 @@ def from_layer(layer: nn.Module, model_config=model_config): if hasattr(layer, "__wrapper_class__" ) and layer.__wrapper_class__ == "HFCompatibleLinear": + HFCompatibleLoRABase = lora_cls # type: type[BaseLayerWithLoRA] - class HFCompatibleLoRA(lora_cls): + class HFCompatibleLoRA(HFCompatibleLoRABase): __class__ = lora_cls __wrapper_class__ = "HFCompatibleLoRA"