mirror of
https://github.com/SakanaAI/doc-to-lora.git
synced 2026-07-23 17:01:04 +02:00
fix attention mask flash attn perceiver
This commit is contained in:
parent
6864424c68
commit
e7a0569745
1 changed files with 1 additions and 0 deletions
|
|
@ -663,6 +663,7 @@ class Idefics2PerceiverResampler(Idefics2PreTrainedModel):
|
|||
seq_lens_k = attention_mask.sum(dim=-1, dtype=torch.int32)
|
||||
cu_seq_lens_k = torch.cumsum(seq_lens_k, dim=0, dtype=torch.int32)
|
||||
max_length_k = seq_lens_k.max().item()
|
||||
cu_seq_lens_k = nn.functional.pad(cu_seq_lens_k, (1, 0))
|
||||
|
||||
elif position_ids is not None:
|
||||
logger.warning_once("Using position ids for resampler")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue