Spaces:
Sleeping
Sleeping
Delete inference.py
Browse files12345678910111213141516171819202122232425262728293031323334353637383940import matplotlib.pyplot as pltimport IPython.display as ipd
import osimport jsonimport mathimport torchfrom torch import nnfrom torch.nn import functional as Ffrom torch.utils.data import DataLoader
import commonsimport utilsfrom data_utils import TextAudioLoader, TextAudioCollate, TextAudioSpeakerLoader, TextAudioSpeakerCollatefrom models import SynthesizerTrnfrom text.symbols import symbolsfrom text import text_to_sequence
from scipy.io.wavfile import write
def get_text(text, hps): text_norm = text_to_sequence(text, hps.data.text_cleaners) if hps.data.add_blank: text_norm = commons.intersperse(text_norm, 0) text_norm = torch.LongTensor(text_norm) return text_norm
hps = utils.get_hparams_from_file("./configs/yuzu.json")
net_g = SynthesizerTrn( len(symbols), hps.data.filter_length // 2 + 1, hps.train.segment_size // hps.data.hop_length, n_speakers=hps.data.n_speakers, **hps.model).cuda()_ = net_g.eval()
_ = utils.load_checkpoint("pretrained_models/yuzu.pth", net_g, None)inference.pyDeleted-40