MCPcopy
hub / github.com/coqui-ai/TTS / test_load_checkpoint

Method test_load_checkpoint

tests/tts_tests2/test_glow_tts.py:327–337  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

325 self.assertTrue(test_audios is not None)
326
327 def test_load_checkpoint(self):
328 chkp_path = os.path.join(get_tests_output_path(), "dummy_glow_tts_checkpoint.pth")
329 config = GlowTTSConfig(num_chars=32)
330 model = GlowTTS.init_from_config(config, verbose=False).to(device)
331 chkp = {}
332 chkp["model"] = model.state_dict()
333 torch.save(chkp, chkp_path)
334 model.load_checkpoint(config, chkp_path)
335 self.assertTrue(model.training)
336 model.load_checkpoint(config, chkp_path, eval=True)
337 self.assertFalse(model.training)
338
339 def test_get_criterion(self):
340 config = GlowTTSConfig(num_chars=32)

Callers

nothing calls this directly

Calls 6

get_tests_output_pathFunction · 0.90
GlowTTSConfigClass · 0.90
state_dictMethod · 0.80
init_from_configMethod · 0.45
saveMethod · 0.45
load_checkpointMethod · 0.45

Tested by

no test coverage detected