def test_train(self): with g2p.tf.Graph().as_default(): g2p_model = g2p.G2PModel(None) train_path = "tests/data/toydict.train" valid_path = "tests/data/toydict.test" test_path = "tests/data/toydict.test" g2p_params = g2p.TrainingParams() g2p_params.steps_per_checkpoint = 1 g2p_params.max_steps = 1 g2p_params.num_layers = 1 g2p_params.size = 2 g2p_model.train(g2p_params, train_path, valid_path, test_path)
def test_train(self): model_dir = "tests/models/train" with g2p.tf.Graph().as_default(): g2p_model = g2p.G2PModel(model_dir) train_path = "tests/data/toydict.train" valid_path = "tests/data/toydict.test" test_path = "tests/data/toydict.test" g2p_params = g2p.TrainingParams() g2p_params.steps_per_checkpoint = 1 g2p_params.max_steps = 1 g2p_params.num_layers = 1 g2p_params.size = 2 g2p_model.prepare_data(train_path, valid_path, test_path) g2p_model.create_train_model(g2p_params) g2p_model.train() shutil.rmtree(model_dir)