AlexK-PL commited on
Commit
261114e
·
1 Parent(s): f95a0dc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -18,13 +18,13 @@ def init_models(hparams):
18
  # load trained tacotron2 + GST model:
19
  model = load_model(hparams)
20
  checkpoint_path = "trained_models/checkpoint_78000.model"
21
- model.load_state_dict(torch.load(checkpoint_path)['state_dict'])
22
  # model.to('cuda')
23
  _ = model.eval()
24
 
25
  # load pre trained MelGAN model for mel2audio:
26
  vocoder_checkpoint_path = "trained_models/nvidia_tacotron2_LJ11_epoch6400.pt"
27
- checkpoint = torch.load(vocoder_checkpoint_path)
28
  hp_melgan = load_hparam("melgan/config/default.yaml")
29
  vocoder_model = Generator(80)
30
  vocoder_model.load_state_dict(checkpoint['model_g'])
 
18
  # load trained tacotron2 + GST model:
19
  model = load_model(hparams)
20
  checkpoint_path = "trained_models/checkpoint_78000.model"
21
+ model.load_state_dict(torch.load(checkpoint_path, map_location="cpu")['state_dict'])
22
  # model.to('cuda')
23
  _ = model.eval()
24
 
25
  # load pre trained MelGAN model for mel2audio:
26
  vocoder_checkpoint_path = "trained_models/nvidia_tacotron2_LJ11_epoch6400.pt"
27
+ checkpoint = torch.load(vocoder_checkpoint_path, map_location="cpu")
28
  hp_melgan = load_hparam("melgan/config/default.yaml")
29
  vocoder_model = Generator(80)
30
  vocoder_model.load_state_dict(checkpoint['model_g'])