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
b67feb12
Unverified
Commit
b67feb12
authored
Nov 04, 2024
by
Gregory Shtrasberg
Committed by
GitHub
Nov 04, 2024
Browse files
[Bugfix]Using the correct type hints (#9885)
Signed-off-by:
Gregory Shtrasberg
<
Gregory.Shtrasberg@amd.com
>
parent
c49f0407
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
vllm/sequence.py
vllm/sequence.py
+5
-3
No files found.
vllm/sequence.py
View file @
b67feb12
...
@@ -6,7 +6,8 @@ from array import array
...
@@ -6,7 +6,8 @@ from array import array
from
collections
import
defaultdict
from
collections
import
defaultdict
from
dataclasses
import
dataclass
,
field
from
dataclasses
import
dataclass
,
field
from
functools
import
cached_property
,
reduce
from
functools
import
cached_property
,
reduce
from
typing
import
TYPE_CHECKING
,
Any
,
Callable
,
Dict
,
List
,
Mapping
,
Optional
from
typing
import
(
TYPE_CHECKING
,
Any
,
Callable
,
DefaultDict
,
Dict
,
List
,
Mapping
,
Optional
)
from
typing
import
Sequence
as
GenericSequence
from
typing
import
Sequence
as
GenericSequence
from
typing
import
Set
,
Tuple
,
Union
,
cast
from
typing
import
Set
,
Tuple
,
Union
,
cast
...
@@ -256,7 +257,8 @@ class SequenceData(msgspec.Struct,
...
@@ -256,7 +257,8 @@ class SequenceData(msgspec.Struct,
return
tuple
(
self
.
_output_token_ids
)
return
tuple
(
self
.
_output_token_ids
)
@
output_token_ids
.
setter
@
output_token_ids
.
setter
def
output_token_ids
(
self
,
new_output_token_ids
:
List
[
int
])
->
None
:
def
output_token_ids
(
self
,
new_output_token_ids
:
GenericSequence
[
int
])
->
None
:
self
.
_output_token_ids
=
array
(
VLLM_TOKEN_ID_ARRAY_TYPE
,
self
.
_output_token_ids
=
array
(
VLLM_TOKEN_ID_ARRAY_TYPE
,
new_output_token_ids
)
new_output_token_ids
)
self
.
_update_cached_all_tokens
()
self
.
_update_cached_all_tokens
()
...
@@ -1173,7 +1175,7 @@ def get_all_seq_ids_and_request_ids(
...
@@ -1173,7 +1175,7 @@ def get_all_seq_ids_and_request_ids(
sequence ids.
sequence ids.
"""
"""
seq_ids
:
List
[
int
]
=
[]
seq_ids
:
List
[
int
]
=
[]
request_id_seq_ids_mapping
:
Dict
[
str
,
Set
[
int
]]
=
defaultdict
(
set
)
request_id_seq_ids_mapping
:
Default
Dict
[
str
,
Set
[
int
]]
=
defaultdict
(
set
)
for
sg
in
seq_group_metadata_list
:
for
sg
in
seq_group_metadata_list
:
for
seq_id
in
sg
.
seq_data
:
for
seq_id
in
sg
.
seq_data
:
seq_ids
.
append
(
seq_id
)
seq_ids
.
append
(
seq_id
)
...
...
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