Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
norm
vllm
Commits
0961f5a4
Commit
0961f5a4
authored
Feb 13, 2023
by
Woosuk Kwon
Browse files
Add find method to sequence group
parent
eb52db1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
cacheflow/sequence.py
cacheflow/sequence.py
+6
-0
No files found.
cacheflow/sequence.py
View file @
0961f5a4
...
...
@@ -76,3 +76,9 @@ class SequenceGroup:
return
len
(
self
.
seqs
)
else
:
return
len
([
seq
for
seq
in
self
.
seqs
if
seq
.
status
==
status
])
def
find
(
self
,
seq_id
:
int
)
->
Sequence
:
for
seq
in
self
.
seqs
:
if
seq
.
seq_id
==
seq_id
:
return
seq
raise
ValueError
(
f
'Sequence
{
seq_id
}
not found.'
)
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