Esempio n. 1
0
    if args.use_cuda:
        model.cuda()
    model.decoder.set_r(cp['r'])

    # load vocoder model
    if args.vocoder_path != "":
        VC = load_config(args.vocoder_config_path)
        ap_vocoder = AudioProcessor(**VC.audio)
        bits = 10
        vocoder_model = VocoderModel(rnn_dims=512,
                                     fc_dims=512,
                                     mode=VC.mode,
                                     mulaw=VC.mulaw,
                                     pad=VC.pad,
                                     upsample_factors=VC.upsample_factors,
                                     feat_dims=VC.audio["num_mels"],
                                     compute_dims=128,
                                     res_out_dims=128,
                                     res_blocks=10,
                                     hop_length=ap.hop_length,
                                     sample_rate=ap.sample_rate,
                                     use_aux_net=True,
                                     use_upsample_net=True)

        check = torch.load(args.vocoder_path)
        vocoder_model.load_state_dict(check['model'])
        vocoder_model.eval()
        if args.use_cuda:
            vocoder_model.cuda()
    else:
        vocoder_model = None
        VC = None
Esempio n. 2
0
        model.cuda()
    model.decoder.set_r(cp['r'])

    # load vocoder model
    if args.vocoder_path != "":
        VC = load_config(args.vocoder_config_path)
        ap_vocoder = AudioProcessor(**VC.audio)
        
        if VC.bits is not None:
                vocoder_model = VocoderModel(
                        rnn_dims=512,
                        fc_dims=512,
                        bits=VC.bits,
                        pad=VC.pad,
                        upsample_factors=VC.upsample_factors,  # set this depending on dataset
                        feat_dims=80,
                        compute_dims=128,
                        res_out_dims=128,
                        res_blocks=10,
                        hop_length=ap.hop_length,
                        sample_rate=ap.sample_rate
                )
        else:
                vocoder_model = VocoderModel(
                        rnn_dims=512,
                        fc_dims=512,
                        mode=VC.mode,
                        mulaw=VC.mulaw,
                        pad=VC.pad,
                        use_aux_net=VC.use_aux_net,
                        use_upsample_net=VC.use_upsample_net,