diff --git a/matcha/hifigan/models.py b/matcha/hifigan/models.py index 46abaf4..94b0ce9 100644 --- a/matcha/hifigan/models.py +++ b/matcha/hifigan/models.py @@ -2,7 +2,7 @@ import torch import torch.nn.functional as F -from torch import nn +import torch.nn as nn # pylint: disable=consider-using-from-import from torch.nn import AvgPool1d, Conv1d, Conv2d, ConvTranspose1d from torch.nn.utils import remove_weight_norm, spectral_norm, weight_norm diff --git a/matcha/models/components/decoder.py b/matcha/models/components/decoder.py index aca5da1..504f88b 100644 --- a/matcha/models/components/decoder.py +++ b/matcha/models/components/decoder.py @@ -2,11 +2,11 @@ import math from typing import Optional import torch +import torch.nn as nn # pylint: disable=consider-using-from-import import torch.nn.functional as F from conformer import ConformerBlock from diffusers.models.activations import get_activation from einops import pack, rearrange, repeat -from torch import nn from matcha.models.components.transformer import BasicTransformerBlock diff --git a/matcha/models/components/text_encoder.py b/matcha/models/components/text_encoder.py index 21cc7d4..36fc65a 100644 --- a/matcha/models/components/text_encoder.py +++ b/matcha/models/components/text_encoder.py @@ -3,8 +3,8 @@ import math import torch +import torch.nn as nn # pylint: disable=consider-using-from-import from einops import rearrange -from torch import nn from matcha import utils from matcha.utils.model import sequence_mask diff --git a/matcha/models/components/transformer.py b/matcha/models/components/transformer.py index eaf0270..4d604f5 100644 --- a/matcha/models/components/transformer.py +++ b/matcha/models/components/transformer.py @@ -1,6 +1,7 @@ from typing import Any, Dict, Optional import torch +import torch.nn as nn # pylint: disable=consider-using-from-import from diffusers.models.attention import ( GEGLU, GELU, @@ -11,7 +12,6 @@ from diffusers.models.attention import ( from diffusers.models.attention_processor import Attention from diffusers.models.lora import LoRACompatibleLinear from diffusers.utils.torch_utils import maybe_allow_in_graph -from torch import nn class SnakeBeta(nn.Module): diff --git a/matcha/models/matcha_tts.py b/matcha/models/matcha_tts.py index 93d9689..092fa27 100644 --- a/matcha/models/matcha_tts.py +++ b/matcha/models/matcha_tts.py @@ -4,11 +4,11 @@ import random import torch +import matcha.utils.monotonic_align as monotonic_align # pylint: disable=consider-using-from-import from matcha import utils from matcha.models.baselightningmodule import BaseLightningClass from matcha.models.components.flow_matching import CFM from matcha.models.components.text_encoder import TextEncoder -from matcha.utils import monotonic_align from matcha.utils.model import ( denormalize, duration_loss,