[BugFix][Core] Fix BlockManagerV2 when Encoder Input is None (#9103)

This commit is contained in:
sroy745
2024-10-07 03:52:42 +00:00
committed by GitHub
parent 487678d046
commit c8f26bb636
3 changed files with 3 additions and 8 deletions
+3 -1
View File
@@ -151,7 +151,9 @@ class BlockSpaceManagerV2(BlockSpaceManager):
block_allocator=self.block_allocator,
max_block_sliding_window=self.max_block_sliding_window,
)
block_table.allocate(seq.get_token_ids())
if seq.get_token_ids():
# Add blocks to the block table only if the sequence is non empty.
block_table.allocate(seq.get_token_ids())
return block_table