Skip to content

Commit e9ddeda

Browse files
DarkLight1337tjtanaa
authored andcommitted
[Misc] Remove redundant TypeVar from base model (vllm-project#12248)
Signed-off-by: DarkLight1337 <[email protected]>
1 parent 66d6dd2 commit e9ddeda

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

vllm/model_executor/models/interfaces_base.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import torch
55
import torch.nn as nn
6-
from transformers import PretrainedConfig
76
from typing_extensions import TypeIs, TypeVar
87

98
from vllm.logger import init_logger
@@ -19,9 +18,6 @@
1918

2019
logger = init_logger(__name__)
2120

22-
# The type of HF config
23-
C_co = TypeVar("C_co", bound=PretrainedConfig, covariant=True)
24-
2521
# The type of hidden states
2622
# Currently, T = torch.Tensor for all models except for Medusa
2723
# which has T = List[torch.Tensor]
@@ -34,7 +30,7 @@
3430

3531

3632
@runtime_checkable
37-
class VllmModel(Protocol[C_co, T_co]):
33+
class VllmModel(Protocol[T_co]):
3834
"""The interface required for all models in vLLM."""
3935

4036
def __init__(
@@ -97,7 +93,7 @@ def is_vllm_model(
9793

9894

9995
@runtime_checkable
100-
class VllmModelForTextGeneration(VllmModel[C_co, T], Protocol[C_co, T]):
96+
class VllmModelForTextGeneration(VllmModel[T], Protocol[T]):
10197
"""The interface required for all generative models in vLLM."""
10298

10399
def compute_logits(
@@ -143,7 +139,7 @@ def is_text_generation_model(
143139

144140

145141
@runtime_checkable
146-
class VllmModelForPooling(VllmModel[C_co, T], Protocol[C_co, T]):
142+
class VllmModelForPooling(VllmModel[T], Protocol[T]):
147143
"""The interface required for all pooling models in vLLM."""
148144

149145
def pooler(

0 commit comments

Comments
 (0)