mirror of
https://github.com/wassname/TTS.git
synced 2026-09-09 11:16:00 +08:00
Fix Pylint issues
This commit is contained in:
@@ -2,7 +2,7 @@ import unittest
|
||||
import torch as T
|
||||
|
||||
from utils.generic_utils import save_checkpoint, save_best_model
|
||||
from layers.tacotron import Prenet, CBHG, Decoder, Encoder
|
||||
from layers.tacotron import Prenet
|
||||
|
||||
OUT_PATH = '/tmp/test.pth.tar'
|
||||
|
||||
@@ -11,14 +11,14 @@ class ModelSavingTests(unittest.TestCase):
|
||||
def save_checkpoint_test(self):
|
||||
# create a dummy model
|
||||
model = Prenet(128, out_features=[256, 128])
|
||||
model = T.nn.DataParallel(layer)
|
||||
model = T.nn.DataParallel(layer) #FIXME: undefined variable layer
|
||||
|
||||
# save the model
|
||||
save_checkpoint(model, None, 100, OUTPATH, 1, 1)
|
||||
save_checkpoint(model, None, 100, OUT_PATH, 1, 1)
|
||||
|
||||
# load the model to CPU
|
||||
model_dict = torch.load(
|
||||
MODEL_PATH, map_location=lambda storage, loc: storage)
|
||||
model_dict = T.load(
|
||||
MODEL_PATH, map_location=lambda storage, loc: storage) #FIXME: undefined variable MODEL_PATH
|
||||
model.load_state_dict(model_dict['model'])
|
||||
|
||||
def save_best_model_test(self):
|
||||
@@ -27,9 +27,9 @@ class ModelSavingTests(unittest.TestCase):
|
||||
model = T.nn.DataParallel(layer)
|
||||
|
||||
# save the model
|
||||
best_loss = save_best_model(model, None, 0, 100, OUT_PATH, 10, 1)
|
||||
save_best_model(model, None, 0, 100, OUT_PATH, 10, 1)
|
||||
|
||||
# load the model to CPU
|
||||
model_dict = torch.load(
|
||||
model_dict = T.load(
|
||||
MODEL_PATH, map_location=lambda storage, loc: storage)
|
||||
model.load_state_dict(model_dict['model'])
|
||||
|
||||
Reference in New Issue
Block a user