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
9f0e69b6
Unverified
Commit
9f0e69b6
authored
Jul 31, 2024
by
Cyrus Leung
Committed by
GitHub
Jul 30, 2024
Browse files
[CI/Build] Fix mypy errors (#6968)
parent
f230cc2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
vllm/_custom_ops.py
vllm/_custom_ops.py
+2
-2
vllm/multimodal/base.py
vllm/multimodal/base.py
+2
-4
No files found.
vllm/_custom_ops.py
View file @
9f0e69b6
import
contextlib
import
functools
from
typing
import
List
,
Optional
,
Tuple
,
Type
from
typing
import
List
,
Optional
,
Tuple
,
Union
import
torch
...
...
@@ -336,7 +336,7 @@ def scaled_fp8_quant(
"""
# This code assumes batch_dim and num_tokens are flattened
assert
(
input
.
ndim
==
2
)
shape
=
input
.
shape
shape
:
Union
[
Tuple
[
int
,
int
],
torch
.
Size
]
=
input
.
shape
if
num_token_padding
:
shape
=
(
max
(
num_token_padding
,
input
.
shape
[
0
]),
shape
[
1
])
output
=
torch
.
empty
(
shape
,
device
=
input
.
device
,
dtype
=
torch
.
float8_e4m3fn
)
...
...
vllm/multimodal/base.py
View file @
9f0e69b6
...
...
@@ -53,9 +53,7 @@ class MultiModalInputs(_MultiModalInputsBase):
"""
@
staticmethod
def
_try_concat
(
tensors
:
List
[
NestedTensors
],
)
->
Union
[
GenericSequence
[
NestedTensors
],
NestedTensors
]:
def
_try_concat
(
tensors
:
List
[
NestedTensors
])
->
BatchedTensors
:
"""
If each input tensor in the batch has the same shape, return a single
batched tensor; otherwise, return a list of :class:`NestedTensors` with
...
...
@@ -105,7 +103,7 @@ class MultiModalInputs(_MultiModalInputsBase):
return
{
k
:
MultiModalInputs
.
_try_concat
(
item_list
)
for
k
,
item_list
in
item_lists
.
items
()
}
# type: ignore
}
@
staticmethod
def
as_kwargs
(
...
...
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