Spaces:
Runtime error
Runtime error
Commit
·
f5c6e96
1
Parent(s):
990f25d
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ import gradio as gr
|
|
5 |
import matplotlib.pyplot as plt
|
6 |
import numpy as np
|
7 |
from scipy.io.wavfile import write
|
|
|
8 |
import wave
|
9 |
|
10 |
device="cpu"
|
@@ -61,7 +62,7 @@ def inference(text):
|
|
61 |
with torch.no_grad():
|
62 |
sequence = np.array(text_to_sequence(i, ['transliteration_cleaners']))[None, :]
|
63 |
sequence = torch.autograd.Variable(torch.from_numpy(sequence)).to(device).long()
|
64 |
-
mel_outputs, mel_outputs_postnet, _, alignments =
|
65 |
# plot_data((mel_outputs_postnet.float().data.cpu().numpy()[0], alignments.float().data.cpu().numpy()[0].T))
|
66 |
audio = waveglow.infer(mel_outputs_postnet, sigma=0.8)
|
67 |
|
@@ -79,7 +80,7 @@ def inference(text):
|
|
79 |
|
80 |
# sequence = np.array(text_to_sequence(i, ['transliteration_cleaners']))[None, :]
|
81 |
# sequence = torch.autograd.Variable(torch.from_numpy(sequence)).to(device).long()
|
82 |
-
# mel_outputs, mel_outputs_postnet, _, alignments =
|
83 |
# audio = hifigan(mel_outputs_postnet.float()).to("cpu")
|
84 |
# audio = audio * MAX_WAV_VALUE
|
85 |
# data = audio.squeeze().detach().cpu().numpy()
|
|
|
5 |
import matplotlib.pyplot as plt
|
6 |
import numpy as np
|
7 |
from scipy.io.wavfile import write
|
8 |
+
from text import symbols, text_to_sequence
|
9 |
import wave
|
10 |
|
11 |
device="cpu"
|
|
|
62 |
with torch.no_grad():
|
63 |
sequence = np.array(text_to_sequence(i, ['transliteration_cleaners']))[None, :]
|
64 |
sequence = torch.autograd.Variable(torch.from_numpy(sequence)).to(device).long()
|
65 |
+
mel_outputs, mel_outputs_postnet, _, alignments = tacotron2.inference(sequence)
|
66 |
# plot_data((mel_outputs_postnet.float().data.cpu().numpy()[0], alignments.float().data.cpu().numpy()[0].T))
|
67 |
audio = waveglow.infer(mel_outputs_postnet, sigma=0.8)
|
68 |
|
|
|
80 |
|
81 |
# sequence = np.array(text_to_sequence(i, ['transliteration_cleaners']))[None, :]
|
82 |
# sequence = torch.autograd.Variable(torch.from_numpy(sequence)).to(device).long()
|
83 |
+
# mel_outputs, mel_outputs_postnet, _, alignments = tacotron2.inference(sequence)
|
84 |
# audio = hifigan(mel_outputs_postnet.float()).to("cpu")
|
85 |
# audio = audio * MAX_WAV_VALUE
|
86 |
# data = audio.squeeze().detach().cpu().numpy()
|