Skip to content

Commit

Permalink
Fix batch > 1 in HunyuanVideo (#10548)
Browse files Browse the repository at this point in the history
  • Loading branch information
hlky authored and DN6 committed Jan 15, 2025
1 parent 13ea83f commit 0e14cac
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,8 @@ def forward(

for i in range(batch_size):
attention_mask[i, : effective_sequence_length[i]] = True
attention_mask = attention_mask.unsqueeze(1) # [B, 1, N], for broadcasting across attention heads
# [B, 1, 1, N], for broadcasting across attention heads
attention_mask = attention_mask.unsqueeze(1).unsqueeze(1)

# 4. Transformer blocks
if torch.is_grad_enabled() and self.gradient_checkpointing:
Expand Down

0 comments on commit 0e14cac

Please sign in to comment.