[Model]Refactor MiniCPMV (#7020)

Co-authored-by: Cyrus Leung <cyrus.tl.leung@gmail.com>
This commit is contained in:
Jee Jee Li
2024-08-04 08:12:41 +00:00
committed by GitHub
co-authored by Cyrus Leung
parent 83c644fe7e
commit 179a6a36f2
4 changed files with 932 additions and 381 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ def _get_unpad_data(attention_mask):
indices = torch.nonzero(attention_mask.flatten(), as_tuple=False).flatten()
max_seqlen_in_batch = seqlens_in_batch.max().item()
cu_seqlens = F.pad(
torch.cumsum(seqlens_in_batch, dim=0, dtype=torch.torch.int32), (1, 0))
torch.cumsum(seqlens_in_batch, dim=0, dtype=torch.int32), (1, 0))
return (
indices,
cu_seqlens,