Skip to content

Commit

Permalink
Address even more lint problems
Browse files Browse the repository at this point in the history
  • Loading branch information
reuben committed Jul 19, 2019
1 parent 057a50a commit e3f8417
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions models/tacotron2.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ def inference_truncated(self, text, speaker_ids=None):

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)
Expand Down
1 change: 1 addition & 0 deletions tests/test_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
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):
Expand Down
2 changes: 2 additions & 0 deletions tests/test_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
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)
Expand Down
2 changes: 2 additions & 0 deletions tests/test_tacotron2_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
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")
Expand Down
4 changes: 3 additions & 1 deletion tests/test_tacotron_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
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")
Expand Down Expand Up @@ -45,7 +47,7 @@ def test_train_step(self):
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,
Expand Down

0 comments on commit e3f8417

Please sign in to comment.