Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
f2e9f2a3
Unverified
Commit
f2e9f2a3
authored
Jan 21, 2025
by
Cyrus Leung
Committed by
GitHub
Jan 21, 2025
Browse files
[Misc] Remove redundant TypeVar from base model (#12248)
Signed-off-by:
DarkLight1337
<
tlleungac@connect.ust.hk
>
parent
1f1542af
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
vllm/model_executor/models/interfaces_base.py
vllm/model_executor/models/interfaces_base.py
+3
-7
No files found.
vllm/model_executor/models/interfaces_base.py
View file @
f2e9f2a3
...
...
@@ -3,7 +3,6 @@ from typing import (TYPE_CHECKING, List, Optional, Protocol, Type, Union,
import
torch
import
torch.nn
as
nn
from
transformers
import
PretrainedConfig
from
typing_extensions
import
TypeIs
,
TypeVar
from
vllm.logger
import
init_logger
...
...
@@ -19,9 +18,6 @@ if TYPE_CHECKING:
logger
=
init_logger
(
__name__
)
# The type of HF config
C_co
=
TypeVar
(
"C_co"
,
bound
=
PretrainedConfig
,
covariant
=
True
)
# The type of hidden states
# Currently, T = torch.Tensor for all models except for Medusa
# which has T = List[torch.Tensor]
...
...
@@ -34,7 +30,7 @@ T_co = TypeVar("T_co", default=torch.Tensor, covariant=True)
@
runtime_checkable
class
VllmModel
(
Protocol
[
C_co
,
T_co
]):
class
VllmModel
(
Protocol
[
T_co
]):
"""The interface required for all models in vLLM."""
def
__init__
(
...
...
@@ -97,7 +93,7 @@ def is_vllm_model(
@
runtime_checkable
class
VllmModelForTextGeneration
(
VllmModel
[
C_co
,
T
],
Protocol
[
C_co
,
T
]):
class
VllmModelForTextGeneration
(
VllmModel
[
T
],
Protocol
[
T
]):
"""The interface required for all generative models in vLLM."""
def
compute_logits
(
...
...
@@ -143,7 +139,7 @@ def is_text_generation_model(
@
runtime_checkable
class
VllmModelForPooling
(
VllmModel
[
C_co
,
T
],
Protocol
[
C_co
,
T
]):
class
VllmModelForPooling
(
VllmModel
[
T
],
Protocol
[
T
]):
"""The interface required for all pooling models in vLLM."""
def
pooler
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment