"benchmarks/vscode:/vscode.git/clone" did not exist on "e23564cb703916efef20d80fd1c32dd76dee0979"
Unverified Commit 34f1a806 authored by Cody Yu's avatar Cody Yu Committed by GitHub
Browse files

[Bugfix][V1] Fix 'NoneType' object has no attribute 'hash_value' (#11157)


Signed-off-by: default avatarCody Yu <hao.yu.cody@gmail.com>
parent 00c1bde5
...@@ -164,6 +164,7 @@ class KVCacheManager: ...@@ -164,6 +164,7 @@ class KVCacheManager:
new_full_blocks = req_blocks[ new_full_blocks = req_blocks[
num_computed_full_blocks:num_full_blocks_after_append] num_computed_full_blocks:num_full_blocks_after_append]
if new_full_blocks:
self._cache_full_blocks( self._cache_full_blocks(
request=request, request=request,
blk_start_idx=num_computed_full_blocks, blk_start_idx=num_computed_full_blocks,
...@@ -375,8 +376,13 @@ class KVCacheManager: ...@@ -375,8 +376,13 @@ class KVCacheManager:
prev_block: The previous block in the chain. prev_block: The previous block in the chain.
""" """
# Update the new blocks with the block hashes through the chain. # Update the new blocks with the block hashes through the chain.
prev_block_hash_value = (prev_block.block_hash.hash_value prev_block_hash_value = None
if prev_block is not None else None) if prev_block is not None:
# Previous block must have a block hash because it must be
# a full, cached block.
assert prev_block.block_hash is not None
prev_block_hash_value = prev_block.block_hash.hash_value
for i, blk in enumerate(full_blocks): for i, blk in enumerate(full_blocks):
blk_idx = blk_start_idx + i blk_idx = blk_start_idx + i
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment