Unverified Commit 7747b588 authored by Aryan's avatar Aryan Committed by GitHub
Browse files

Fix hunyuan video attention mask dim (#10454)



* fix

* add coauthor
Co-Authored-By: default avatarNerogar <nerogar@arcor.de>

---------
Co-authored-by: default avatarNerogar <nerogar@arcor.de>
parent d9d94e12
...@@ -721,6 +721,7 @@ class HunyuanVideoTransformer3DModel(ModelMixin, ConfigMixin, PeftAdapterMixin, ...@@ -721,6 +721,7 @@ class HunyuanVideoTransformer3DModel(ModelMixin, ConfigMixin, PeftAdapterMixin,
for i in range(batch_size): for i in range(batch_size):
attention_mask[i, : effective_sequence_length[i], : effective_sequence_length[i]] = True attention_mask[i, : effective_sequence_length[i], : effective_sequence_length[i]] = True
attention_mask = attention_mask.unsqueeze(1) # [B, 1, N, N], for broadcasting across attention heads
# 4. Transformer blocks # 4. Transformer blocks
if torch.is_grad_enabled() and self.gradient_checkpointing: if torch.is_grad_enabled() and self.gradient_checkpointing:
......
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