Skip to content

Commit

Permalink
Make mypy happy
Browse files Browse the repository at this point in the history
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
  • Loading branch information
hmellor committed Mar 3, 2025
1 parent a8d2279 commit 5a4442b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vllm/lora/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

logger = init_logger(__name__)

_all_lora_classes: set[BaseLayerWithLoRA] = {
_all_lora_classes: set[type[BaseLayerWithLoRA]] = {
VocabParallelEmbeddingWithLoRA,
ColumnParallelLinearWithLoRA,
MergedColumnParallelLinearWithLoRA,
Expand Down Expand Up @@ -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):

Check failure on line 73 in vllm/lora/utils.py

View workflow job for this annotation

GitHub Actions / pre-commit

Variable "HFCompatibleLoRABase" is not valid as a type [valid-type]

Check failure on line 73 in vllm/lora/utils.py

View workflow job for this annotation

GitHub Actions / pre-commit

Invalid base class "HFCompatibleLoRABase" [misc]

Check failure on line 73 in vllm/lora/utils.py

View workflow job for this annotation

GitHub Actions / pre-commit

Variable "HFCompatibleLoRABase" is not valid as a type [valid-type]

Check failure on line 73 in vllm/lora/utils.py

View workflow job for this annotation

GitHub Actions / pre-commit

Invalid base class "HFCompatibleLoRABase" [misc]

Check failure on line 73 in vllm/lora/utils.py

View workflow job for this annotation

GitHub Actions / pre-commit

Variable "HFCompatibleLoRABase" is not valid as a type [valid-type]

Check failure on line 73 in vllm/lora/utils.py

View workflow job for this annotation

GitHub Actions / pre-commit

Invalid base class "HFCompatibleLoRABase" [misc]

Check failure on line 73 in vllm/lora/utils.py

View workflow job for this annotation

GitHub Actions / pre-commit

Variable "HFCompatibleLoRABase" is not valid as a type [valid-type]

Check failure on line 73 in vllm/lora/utils.py

View workflow job for this annotation

GitHub Actions / pre-commit

Invalid base class "HFCompatibleLoRABase" [misc]

Check failure on line 73 in vllm/lora/utils.py

View workflow job for this annotation

GitHub Actions / pre-commit

Variable "HFCompatibleLoRABase" is not valid as a type [valid-type]

Check failure on line 73 in vllm/lora/utils.py

View workflow job for this annotation

GitHub Actions / pre-commit

Invalid base class "HFCompatibleLoRABase" [misc]
__class__ = lora_cls
__wrapper_class__ = "HFCompatibleLoRA"

Expand Down

0 comments on commit 5a4442b

Please sign in to comment.