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
94063534
Unverified
Commit
94063534
authored
Nov 26, 2024
by
Cyrus Leung
Committed by
GitHub
Nov 26, 2024
Browse files
[Misc] Remove outdated init protocols (#10655)
Signed-off-by:
DarkLight1337
<
tlleungac@connect.ust.hk
>
parent
9a88f897
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
31 deletions
+1
-31
vllm/model_executor/models/interfaces.py
vllm/model_executor/models/interfaces.py
+0
-30
vllm/model_executor/models/interfaces_base.py
vllm/model_executor/models/interfaces_base.py
+1
-1
No files found.
vllm/model_executor/models/interfaces.py
View file @
94063534
...
@@ -10,7 +10,6 @@ from vllm.utils import supports_kw
...
@@ -10,7 +10,6 @@ from vllm.utils import supports_kw
from
.interfaces_base
import
is_embedding_model
from
.interfaces_base
import
is_embedding_model
if
TYPE_CHECKING
:
if
TYPE_CHECKING
:
from
vllm.config
import
LoRAConfig
,
MultiModalConfig
,
SchedulerConfig
from
vllm.sequence
import
IntermediateTensors
from
vllm.sequence
import
IntermediateTensors
logger
=
init_logger
(
__name__
)
logger
=
init_logger
(
__name__
)
...
@@ -29,9 +28,6 @@ class SupportsMultiModal(Protocol):
...
@@ -29,9 +28,6 @@ class SupportsMultiModal(Protocol):
MRO of your model class.
MRO of your model class.
"""
"""
def
__init__
(
self
,
*
,
multimodal_config
:
"MultiModalConfig"
)
->
None
:
...
# We can't use runtime_checkable with ClassVar for issubclass checks
# We can't use runtime_checkable with ClassVar for issubclass checks
# so we need to treat the class as an instance and use isinstance instead
# so we need to treat the class as an instance and use isinstance instead
...
@@ -39,9 +35,6 @@ class SupportsMultiModal(Protocol):
...
@@ -39,9 +35,6 @@ class SupportsMultiModal(Protocol):
class
_SupportsMultiModalType
(
Protocol
):
class
_SupportsMultiModalType
(
Protocol
):
supports_multimodal
:
Literal
[
True
]
supports_multimodal
:
Literal
[
True
]
def
__call__
(
self
,
*
,
multimodal_config
:
"MultiModalConfig"
)
->
None
:
...
@
overload
@
overload
def
supports_multimodal
(
def
supports_multimodal
(
...
@@ -81,10 +74,6 @@ class SupportsLoRA(Protocol):
...
@@ -81,10 +74,6 @@ class SupportsLoRA(Protocol):
embedding_modules
:
ClassVar
[
Dict
[
str
,
str
]]
embedding_modules
:
ClassVar
[
Dict
[
str
,
str
]]
embedding_padding_modules
:
ClassVar
[
List
[
str
]]
embedding_padding_modules
:
ClassVar
[
List
[
str
]]
# lora_config is None when LoRA is not enabled
def
__init__
(
self
,
*
,
lora_config
:
Optional
[
"LoRAConfig"
]
=
None
)
->
None
:
...
# We can't use runtime_checkable with ClassVar for issubclass checks
# We can't use runtime_checkable with ClassVar for issubclass checks
# so we need to treat the class as an instance and use isinstance instead
# so we need to treat the class as an instance and use isinstance instead
...
@@ -97,9 +86,6 @@ class _SupportsLoRAType(Protocol):
...
@@ -97,9 +86,6 @@ class _SupportsLoRAType(Protocol):
embedding_modules
:
Dict
[
str
,
str
]
embedding_modules
:
Dict
[
str
,
str
]
embedding_padding_modules
:
List
[
str
]
embedding_padding_modules
:
List
[
str
]
def
__call__
(
self
,
*
,
lora_config
:
Optional
[
"LoRAConfig"
]
=
None
)
->
None
:
...
@
overload
@
overload
def
supports_lora
(
model
:
Type
[
object
])
->
TypeIs
[
Type
[
SupportsLoRA
]]:
def
supports_lora
(
model
:
Type
[
object
])
->
TypeIs
[
Type
[
SupportsLoRA
]]:
...
@@ -276,21 +262,11 @@ class HasInnerState(Protocol):
...
@@ -276,21 +262,11 @@ class HasInnerState(Protocol):
for max_num_seqs, etc. True for e.g. both Mamba and Jamba.
for max_num_seqs, etc. True for e.g. both Mamba and Jamba.
"""
"""
def
__init__
(
self
,
*
,
scheduler_config
:
Optional
[
"SchedulerConfig"
]
=
None
)
->
None
:
...
@
runtime_checkable
@
runtime_checkable
class
_HasInnerStateType
(
Protocol
):
class
_HasInnerStateType
(
Protocol
):
has_inner_state
:
ClassVar
[
Literal
[
True
]]
has_inner_state
:
ClassVar
[
Literal
[
True
]]
def
__init__
(
self
,
*
,
scheduler_config
:
Optional
[
"SchedulerConfig"
]
=
None
)
->
None
:
...
@
overload
@
overload
def
has_inner_state
(
model
:
object
)
->
TypeIs
[
HasInnerState
]:
def
has_inner_state
(
model
:
object
)
->
TypeIs
[
HasInnerState
]:
...
@@ -323,17 +299,11 @@ class IsAttentionFree(Protocol):
...
@@ -323,17 +299,11 @@ class IsAttentionFree(Protocol):
True for Mamba but not Jamba.
True for Mamba but not Jamba.
"""
"""
def
__init__
(
self
)
->
None
:
...
@
runtime_checkable
@
runtime_checkable
class
_IsAttentionFreeType
(
Protocol
):
class
_IsAttentionFreeType
(
Protocol
):
is_attention_free
:
ClassVar
[
Literal
[
True
]]
is_attention_free
:
ClassVar
[
Literal
[
True
]]
def
__init__
(
self
)
->
None
:
...
@
overload
@
overload
def
is_attention_free
(
model
:
object
)
->
TypeIs
[
IsAttentionFree
]:
def
is_attention_free
(
model
:
object
)
->
TypeIs
[
IsAttentionFree
]:
...
...
vllm/model_executor/models/interfaces_base.py
View file @
94063534
...
@@ -71,7 +71,7 @@ def _check_vllm_model_forward(model: Union[Type[object], object]) -> bool:
...
@@ -71,7 +71,7 @@ def _check_vllm_model_forward(model: Union[Type[object], object]) -> bool:
and
issubclass
(
model
,
nn
.
Module
)):
and
issubclass
(
model
,
nn
.
Module
)):
logger
.
warning
(
logger
.
warning
(
"The model (%s) is missing "
"The model (%s) is missing "
"vLLM-specific keywords from its
initializer
: %s"
,
"vLLM-specific keywords from its
`forward` method
: %s"
,
model
,
model
,
missing_kws
,
missing_kws
,
)
)
...
...
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