@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / b39f149a08
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 17, 09:15 UTC

Add is_finished

Woosuk Kwon committed Feb 24, 2023 at 11:44 UTC b39f149a0853c6b6d48716f21fbb7b97828d17f4
1 file changed +3
cacheflow/sequence.py
+3
@@ -86,6 +86,9 @@ class SequenceGroup:
86 return seq
87 raise ValueError(f'Sequence {seq_id} not found.')
88
89 + def is_finished(self) -> bool:
90 + return all(seq.status == SequenceStatus.FINISHED for seq in self.seqs)
91 +
92 def __repr__(self) -> str:
93 return (f'SequenceGroup(group_id={self.group_id}, '
94 f'num_seqs={len(self.seqs)})')