mirror of
https://github.com/vllm-project/vllm.git
synced 2025-10-20 23:03:52 +08:00
Fix pre-commit (#22487)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
@ -589,7 +589,7 @@ class MiniCPMO(MiniCPMV2_6):
|
|||||||
ret = torch.zeros(size, size, device=device, dtype=torch.bool)
|
ret = torch.zeros(size, size, device=device, dtype=torch.bool)
|
||||||
# Vectorized computation of row indices and chunk boundaries
|
# Vectorized computation of row indices and chunk boundaries
|
||||||
row_indices = torch.arange(size, device=device)
|
row_indices = torch.arange(size, device=device)
|
||||||
chunk_indices = row_indices // chunk_size
|
chunk_indices = row_indices // chunk_size
|
||||||
if num_left_chunks < 0:
|
if num_left_chunks < 0:
|
||||||
# If num_left_chunks < 0, start is always 0 for all rows
|
# If num_left_chunks < 0, start is always 0 for all rows
|
||||||
start_indices = torch.zeros_like(row_indices)
|
start_indices = torch.zeros_like(row_indices)
|
||||||
@ -597,7 +597,7 @@ class MiniCPMO(MiniCPMV2_6):
|
|||||||
# Compute start indices vectorially
|
# Compute start indices vectorially
|
||||||
start_chunk_indices = torch.clamp(chunk_indices - num_left_chunks,
|
start_chunk_indices = torch.clamp(chunk_indices - num_left_chunks,
|
||||||
min=0)
|
min=0)
|
||||||
start_indices = start_chunk_indices * chunk_size
|
start_indices = start_chunk_indices * chunk_size
|
||||||
# Compute ending indices vectorially
|
# Compute ending indices vectorially
|
||||||
end_chunk_indices = chunk_indices + 1
|
end_chunk_indices = chunk_indices + 1
|
||||||
end_indices = torch.clamp(end_chunk_indices * chunk_size +
|
end_indices = torch.clamp(end_chunk_indices * chunk_size +
|
||||||
|
Reference in New Issue
Block a user