Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

Commit 39b0e73

Browse files
author
Huy Vu2
committed
lint, ruff
1 parent a13d0c0 commit 39b0e73

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

dfm/src/megatron/data/wan/wan_mock_energon_datamodule.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
from dataclasses import dataclass
1818

1919
import torch
20-
from megatron.bridge.data.utils import DatasetBuildContext, DatasetProvider
2120
from torch.utils.data import DataLoader, Dataset
21+
from megatron.bridge.data.utils import DatasetBuildContext, DatasetProvider
2222

2323
from dfm.src.megatron.model.wan.utils import patchify
2424

25+
2526
class _MockDataset(Dataset):
2627
def __init__(self, length: int):
2728
self.length = max(int(length), 1)
@@ -32,6 +33,7 @@ def __len__(self) -> int:
3233
def __getitem__(self, idx: int) -> dict:
3334
return {}
3435

36+
3537
def mock_batch(
3638
F_latents: int,
3739
H_latents: int,
@@ -92,6 +94,7 @@ def mock_batch(
9294

9395
return batch
9496

97+
9598
@dataclass(kw_only=True)
9699
class WanMockDataModuleConfig(DatasetProvider):
97100
path: str = ""

dfm/src/megatron/data/wan/wan_taskencoder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def encode_sample(self, sample: dict) -> dict:
142142
seq_len_q=torch.tensor([seq_len_q], dtype=torch.int32),
143143
seq_len_q_padded=torch.tensor([seq_len_q_padded], dtype=torch.int32),
144144
seq_len_kv=torch.tensor([seq_len_kv], dtype=torch.int32),
145-
pos_ids=torch.zeros(1, dtype=torch.bfloat16), # dummy pos_ids
145+
pos_ids=torch.zeros(1, dtype=torch.bfloat16), # dummy pos_ids
146146
video_metadata=video_metadata,
147147
)
148148

dfm/src/megatron/model/wan/flow_matching/flow_pipeline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def training_step(
4343
logit_std: float = 1.0,
4444
flow_shift: float = 3.0,
4545
mix_uniform_ratio: float = 0.1,
46-
sigma_min: float = 0.0, # Default: no clamping (pretrain)
47-
sigma_max: float = 1.0, # Default: no clamping (pretrain)
46+
sigma_min: float = 0.0, # Default: no clamping (pretrain)
47+
sigma_max: float = 1.0, # Default: no clamping (pretrain)
4848
) -> tuple[dict[str, torch.Tensor], torch.Tensor]:
4949
"""
5050
Performs a single training step using flow matching algorithm.

dfm/src/megatron/model/wan/wan_provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
@dataclass
3232
class WanModelProvider(TransformerConfig, ModelProviderMixin[VisionModule]):
33-
crossattn_emb_size: int = 1536 # cross attention emebedding size after linear projection
33+
crossattn_emb_size: int = 1536 # cross attention emebedding size after linear projection
3434
add_bias_linear: bool = True
3535
gated_linear_unit: bool = False
3636

0 commit comments

Comments
 (0)