Views
No views yet
1from fairseq.checkpoint_utils import load_model_ensemble_and_task_from_hf_hub
2from fairseq.models.text_to_speech.hub_interface import TTSHubInterface
3import IPython.display as ipd
4
5
6models, cfg, task = load_model_ensemble_and_task_from_hf_hub(
7 "facebook/fastspeech2-en-ljspeech",
8 arg_overrides={"vocoder": "hifigan", "fp16": False}
9)
10model = models[0]
11TTSHubInterface.update_cfg_with_data_cfg(cfg, task.data_cfg)
12generator = task.build_generator(model, cfg)
13
14text = "Hello, this is a test run."
15
16sample = TTSHubInterface.get_model_input(task, text)
17wav, rate = TTSHubInterface.get_prediction(task, model, generator, sample)
18
19ipd.Audio(wav, rate=rate)1@inproceedings{wang-etal-2021-fairseq,
2 title = "fairseq S{\^{}}2: A Scalable and Integrable Speech Synthesis Toolkit",
3 author = "Wang, Changhan and
4 Hsu, Wei-Ning and
5 Adi, Yossi and
6 Polyak, Adam and
7 Lee, Ann and
8 Chen, Peng-Jen and
9 Gu, Jiatao and
10 Pino, Juan",
11 booktitle = "Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing: System Demonstrations",
12 month = nov,
13 year = "2021",
14 address = "Online and Punta Cana, Dominican Republic",
15 publisher = "Association for Computational Linguistics",
16 url = "https://aclanthology.org/2021.emnlp-demo.17",
17 doi = "10.18653/v1/2021.emnlp-demo.17",
18 pages = "143--152",
19}