Skip to content

Commit 7d8e64f

Browse files
author
Huy Vu2
committed
fix Ruff, lint
1 parent 66796b5 commit 7d8e64f

File tree

8 files changed

+9
-9
lines changed

8 files changed

+9
-9
lines changed

dfm/src/megatron/data/common/base_energon_datamodule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,4 +336,4 @@ def load_state_dict(self, state_dict: Dict[str, Any]) -> None:
336336
update_num_microbatches(
337337
consumed_samples=consumed_samples,
338338
consistency_check=False,
339-
)
339+
)

dfm/src/megatron/data/common/diffusion_energon_datamodule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,4 @@ def load_state_dict(self, state_dict: Dict[str, Any]) -> None:
182182
try:
183183
super().load_state_dict(state_dict)
184184
except Exception as e:
185-
logging.warning(f"datamodule.load_state_dict failed {e}")
185+
logging.warning(f"datamodule.load_state_dict failed {e}")

dfm/src/megatron/data/common/diffusion_sample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,4 @@ def __lt__(self, other: Any) -> bool:
9393
return self.seq_len_q.item() < other.seq_len_q.item()
9494
elif isinstance(other, int):
9595
return self.seq_len_q.item() < other
96-
raise NotImplementedError
96+
raise NotImplementedError

dfm/src/megatron/data/common/diffusion_task_encoder_with_sp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,4 @@ def cat(attr):
109109

110110
@stateless
111111
def batch(self, samples: List[DiffusionSample]) -> dict:
112-
raise NotImplementedError
112+
raise NotImplementedError

dfm/src/megatron/data/common/sequence_packing_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,4 @@ def concat_pad(tensor_list, max_seq_length):
102102
result[current_index : current_index + length] = tensor
103103
current_index += length
104104

105-
return result
105+
return result

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from megatron.core import parallel_state
2323
from megatron.energon import SkipSample
2424
from megatron.energon.task_encoder.base import stateless
25-
from megatron.energon.task_encoder.cooking import Cooker, basic_sample_keys
25+
from megatron.energon.task_encoder.cooking import basic_sample_keys, Cooker
2626
import torch
2727
import torch.nn.functional as F
2828

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,4 @@ def forward(self, n_head, dim_head, cu_seqlens_q_padded, grid_sizes, device):
8686
# we don't need to scatter the freqs to the context parallel region,
8787
# because mcore rope_utils will automatically retrieve the correct freqs for each context parallel region
8888

89-
return freqs_real
89+
return freqs_real

examples/megatron/recipes/wan/prepare_energon_dataset_wan.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
from typing import Dict, List, Optional, Tuple
1919

2020
import cv2
21-
from diffusers import AutoencoderKLWan
2221
import numpy as np
2322
import torch
24-
from transformers import AutoTokenizer, UMT5EncoderModel
2523
import webdataset as wds
24+
from diffusers import AutoencoderKLWan
25+
from transformers import AutoTokenizer, UMT5EncoderModel
2626

2727

2828
def _map_interpolation(resize_mode: str) -> int:

0 commit comments

Comments
 (0)