"src/lib/vscode:/vscode.git/clone" did not exist on "bb98c10abbc1a5d25712937c00a743bc8a8cb016"
Commit 7cc0d202 authored by dcuai's avatar dcuai
Browse files

Update modeling_minicpm.py ——.flatten()

parent 6183fe60
......@@ -78,7 +78,7 @@ def _get_unpad_data(attention_mask):
seqlens_in_batch = attention_mask.sum(dim=-1, dtype=torch.int32)
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))
cu_seqlens = F.pad(torch.cumsum(seqlens_in_batch.flatten(), dim=0, dtype=torch.torch.int32), (1, 0))
return (
indices,
cu_seqlens,
......
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