diff --git a/examples/pytorch/llm/_common.py b/examples/pytorch/llm/_common.py index ad82e086..77952f3c 100644 --- a/examples/pytorch/llm/_common.py +++ b/examples/pytorch/llm/_common.py @@ -445,7 +445,7 @@ def plot_image(tb_dir: str, fname = os.listdir(tb_dir)[0] tb_path = os.path.join(tb_dir, fname) data = read_tensorboard_file(tb_path) - # + for k in data.keys(): _data = data[k] steps = [d['step'] for d in _data] diff --git a/modelscope/models/cv/video_stabilization/utils/WarpUtils.py b/modelscope/models/cv/video_stabilization/utils/WarpUtils.py index eefd8697..e8f713cd 100644 --- a/modelscope/models/cv/video_stabilization/utils/WarpUtils.py +++ b/modelscope/models/cv/video_stabilization/utils/WarpUtils.py @@ -46,9 +46,8 @@ def mesh_warp_frame(frame, x_motion, y_motion, cap_width, cap_height): homo, origin_kp.contiguous().view(2, -1).permute(1, 0)).permute(1, 0) - projection.append( - projected_kp.contiguous().view(*origin_kp.shape).permute( - 1, 2, 0)) # 2, H, W --> H, W, 2 + projection.append(projected_kp.contiguous().view( + *origin_kp.shape).permute(1, 2, 0)) # 2, H, W --> H, W, 2 projection = torch.stack(projection, 0) projection[:, :, :, 0] = projection[:, :, :, 0] / cfg.MODEL.WIDTH * 2. - 1. diff --git a/modelscope/models/nlp/gpt_moe/moe/sharded_moe.py b/modelscope/models/nlp/gpt_moe/moe/sharded_moe.py index ff12e13a..f8eed00f 100644 --- a/modelscope/models/nlp/gpt_moe/moe/sharded_moe.py +++ b/modelscope/models/nlp/gpt_moe/moe/sharded_moe.py @@ -430,9 +430,9 @@ class MOELayer(Base): self.use_expert_residual_network = use_expert_residual_network if self.use_expert_residual_network: - self.expert_network = nn.Sequential( - *([ExpertResidualLayer(self.gate.model_dim) - for _ in range(6)])) # noqa + self.expert_network = nn.Sequential(*([ + ExpertResidualLayer(self.gate.model_dim) for _ in range(6) + ])) # noqa self.use_tutel = use_tutel and TUTEL_INSTALLED