mirror of
https://github.com/wassname/vllm.git
synced 2026-10-01 12:42:39 +08:00
Add get_len
This commit is contained in:
1 parent
d094512296
commit
af16c05074
1 file changed
+3
@@ -49,6 +49,9 @@ class Sequence:
|
||||
last_block.append(token_ids[:num_empty_slots])
|
||||
token_ids = token_ids[num_empty_slots:]
|
||||
|
||||
def get_len(self) -> int:
|
||||
return sum(block.num_tokens for block in self.logical_token_blocks)
|
||||
|
||||
def get_token_ids(self) -> List[int]:
|
||||
token_ids: List[int] = []
|
||||
for block in self.logical_token_blocks:
|
||||
|
||||
Reference in new issue
Block a user