uncommitted changes

This commit is contained in:
Brandon Thomas
2020-06-14 23:19:34 -04:00
parent 7a5e0033db
commit 788eef5e1a
2 changed files with 9 additions and 7 deletions
+6 -4
View File
@@ -36,7 +36,6 @@ def load(model_checkpoint_path):
with torch.no_grad(): with torch.no_grad():
# NB(bt): This should fix the following: # NB(bt): This should fix the following:
# RuntimeError: Cannot insert a Tensor that requires grad as a constant. # RuntimeError: Cannot insert a Tensor that requires grad as a constant.
# Consider making it a parameter or input, or detaching the gradient Tensor:
model = models.FlowGenerator( model = models.FlowGenerator(
len(symbols), len(symbols),
out_channels=hps.data.n_mel_channels, out_channels=hps.data.n_mel_channels,
@@ -50,15 +49,18 @@ def load(model_checkpoint_path):
#model_checkpoint_path = '/home/bt/models/glow-tts-jaywalnut/pretrained.pth' #model_checkpoint_path = '/home/bt/models/glow-tts-jaywalnut/pretrained.pth'
model_checkpoint_path = '/home/bt/models/glow-tts-jaywalnut/G_1007.pth' model_checkpoint_path = '/home/bt/models/glow-tts-jaywalnut/glow_tts_ljs_txlearn_arpabet_2020-06-01_G_1689.pth'
model_checkpoint_path = '/home/bt/models/glow-tts-jaywalnut/glow_tts_ljs_txlearn_arpabet_2020-06-01_G_2590.pth'
model_checkpoint_path = '/home/bt/models/glow-tts-jaywalnut/glow_tts_ljs_txlearn_arpabet_2020-06-01_G_3614.pth'
hps, glow_model = load(model_checkpoint_path) hps, glow_model = load(model_checkpoint_path)
output_filename = 'output.torchjit' output_filename = 'glow_tts_ljs_txlearn_arpabet_2020-06-01_G_2590.torchjit'
output_filename = 'glow_tts_ljs_txlearn_arpabet_2020-06-01_G_3614.torchjit'
cmu_dict = cmudict.CMUDict(hps.data.cmudict_path) cmu_dict = cmudict.CMUDict(hps.data.cmudict_path)
tst_stn = "my name is donald trump and I am the president of the united states, you should respect me" tst_stn = "This is a test of the machine learning model. How does this sound?"
seq = text_to_sequence(tst_stn, ['english_cleaners'], cmu_dict) seq = text_to_sequence(tst_stn, ['english_cleaners'], cmu_dict)
sequence = np.array(seq)[None, :] # NB: None adds a new axis. sequence = np.array(seq)[None, :] # NB: None adds a new axis.
print("".join([symbols[c] for c in sequence[0]])) print("".join([symbols[c] for c in sequence[0]]))