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

Method test_run

TTS/tts/models/vits.py:1428–1456  ·  view source on GitHub ↗

Generic test run for `tts` models used by `Trainer`. You can override this for a different behaviour. Returns: Tuple[Dict, Dict]: Test figures and audios to be projected to Tensorboard.

(self, assets)

Source from the content-addressed store, hash-verified

1426
1427 @torch.no_grad()
1428 def test_run(self, assets) -> Tuple[Dict, Dict]:
1429 """Generic test run for `tts` models used by `Trainer`.
1430
1431 You can override this for a different behaviour.
1432
1433 Returns:
1434 Tuple[Dict, Dict]: Test figures and audios to be projected to Tensorboard.
1435 """
1436 print(" | > Synthesizing test sentences.")
1437 test_audios = {}
1438 test_figures = {}
1439 test_sentences = self.config.test_sentences
1440 for idx, s_info in enumerate(test_sentences):
1441 aux_inputs = self.get_aux_input_from_test_sentences(s_info)
1442 wav, alignment, _, _ = synthesis(
1443 self,
1444 aux_inputs["text"],
1445 self.config,
1446 "cuda" in str(next(self.parameters()).device),
1447 speaker_id=aux_inputs["speaker_id"],
1448 d_vector=aux_inputs["d_vector"],
1449 style_wav=aux_inputs["style_wav"],
1450 language_id=aux_inputs["language_id"],
1451 use_griffin_lim=True,
1452 do_trim_silence=False,
1453 ).values()
1454 test_audios["{}-audio".format(idx)] = wav
1455 test_figures["{}-alignment".format(idx)] = plot_alignment(alignment.T, output_fig=False)
1456 return {"figures": test_figures, "audios": test_audios}
1457
1458 def test_log(
1459 self, outputs: dict, logger: "Logger", assets: dict, steps: int # pylint: disable=unused-argument

Callers 2

test_test_runMethod · 0.45
test_test_runMethod · 0.45

Calls 3

synthesisFunction · 0.90
plot_alignmentFunction · 0.90

Tested by

no test coverage detected