Views
No views yet
1import torch
2import yaml
3
4# Load config
5with open('config.json') as f:
6 config = yaml.safe_load(f)
7
8# Load generator
9generator = Generator(config).cuda()
10state_dict = torch.load('generator_best.pt')
11generator.load_state_dict(state_dict)
12generator.eval()
13
14# Generate audio
15with torch.no_grad():
16 audio = generator(mel_spectrogram)1@article{kong2020hifigan,
2 title={HiFi-GAN: Generative Adversarial Networks for Efficient and High Fidelity Speech Synthesis},
3 author={Kong, Jungil and Kim, Jaehyeon and Bae, Jack},
4 journal={arXiv preprint arXiv:2010.05646},
5 year={2020}
6}