def __init__(self, device='cpu', speaker_embedding=None):
    super().__init__()
    self.speaker_embedding = None
    self.device = device
    self.text2phone = TextFrontend(language='en', use_word_boundaries=False, use_explicit_eos=False, inference=True)
    self.phone2mel = Tacotron2(path_to_weights=os.path.join('Models', 'Tacotron2_Nancy', 'best.pt'), idim=166, odim=80, spk_embed_dim=None, reduction_factor=1).to(torch.device(device))
    self.mel2wav = HiFiGANGenerator(path_to_weights=os.path.join('Models', 'HiFiGAN_combined', 'best.pt')).to(torch.device(device))
    self.phone2mel.eval()
    self.mel2wav.eval()
    self.to(torch.device(device))
def __init__(self, device='cpu', speaker_embedding=None):
    super().__init__()
    self.speaker_embedding = None
    self.device = device
    self.text2phone = TextFrontend(language='en', use_word_boundaries=False, use_explicit_eos=False, inference=True)
    self.phone2mel = Tacotron2(path_to_weights=os.path.join('Models', 'Tacotron2_Nancy', 'best.pt'), idim=166, odim=80, spk_embed_dim=None, reduction_factor=1).to(torch.device(device))
    self.mel2wav = HiFiGANGenerator(path_to_weights=os.path.join('Models', 'HiFiGAN_combined', 'best.pt')).to(torch.device(device))
    self.phone2mel.eval()
    self.mel2wav.eval()
    self.to(torch.device(device))