mirror of https://github.com/coqui-ai/TTS.git
Address even more lint problems
This commit is contained in:
parent
057a50a889
commit
e3f841742d
|
@ -88,8 +88,8 @@ class Tacotron2(nn.Module):
|
|||
|
||||
def _add_speaker_embedding(self, encoder_outputs, speaker_ids):
|
||||
if hasattr(self, "speaker_embedding") and speaker_ids is None:
|
||||
raise RuntimeError(" [!] Model has speaker embedding layer but speaker_id is not provided")
|
||||
elif hasattr(self, "speaker_embedding") and speaker_ids is not None:
|
||||
raise RuntimeError(" [!] Model has speaker embedding layer but speaker_id is not provided")
|
||||
if hasattr(self, "speaker_embedding") and speaker_ids is not None:
|
||||
speaker_embeddings = self.speaker_embedding(speaker_ids)
|
||||
|
||||
speaker_embeddings.unsqueeze_(1)
|
||||
|
|
|
@ -5,6 +5,7 @@ from layers.tacotron import Prenet, CBHG, Decoder, Encoder
|
|||
from layers.losses import L1LossMasked
|
||||
from utils.generic_utils import sequence_mask
|
||||
|
||||
#pylint: disable=unused-variable
|
||||
|
||||
class PrenetTests(unittest.TestCase):
|
||||
def test_in_out(self):
|
||||
|
|
|
@ -8,6 +8,8 @@ from utils.audio import AudioProcessor
|
|||
from datasets import TTSDataset
|
||||
from datasets.preprocess import ljspeech
|
||||
|
||||
#pylint: disable=unused-variable
|
||||
|
||||
file_path = os.path.dirname(os.path.realpath(__file__))
|
||||
OUTPATH = os.path.join(file_path, "outputs/loader_tests/")
|
||||
os.makedirs(OUTPATH, exist_ok=True)
|
||||
|
|
|
@ -10,6 +10,8 @@ from utils.generic_utils import load_config
|
|||
from layers.losses import MSELossMasked
|
||||
from models.tacotron2 import Tacotron2
|
||||
|
||||
#pylint: disable=unused-variable
|
||||
|
||||
torch.manual_seed(1)
|
||||
use_cuda = torch.cuda.is_available()
|
||||
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
||||
|
|
|
@ -9,6 +9,8 @@ from utils.generic_utils import load_config
|
|||
from layers.losses import L1LossMasked
|
||||
from models.tacotron import Tacotron
|
||||
|
||||
#pylint: disable=unused-variable
|
||||
|
||||
torch.manual_seed(1)
|
||||
use_cuda = torch.cuda.is_available()
|
||||
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
||||
|
@ -45,7 +47,7 @@ class TacotronTrainTest(unittest.TestCase):
|
|||
criterion_st = nn.BCEWithLogitsLoss().to(device)
|
||||
model = Tacotron(
|
||||
32,
|
||||
5,
|
||||
5,
|
||||
linear_dim=c.audio['num_freq'],
|
||||
mel_dim=c.audio['num_mels'],
|
||||
r=c.r,
|
||||
|
|
Loading…
Reference in New Issue