Spaces:
Running
on
Zero
Running
on
Zero
Serhiy Stetskovych
commited on
Commit
·
e9b5617
1
Parent(s):
a13fe69
Fix bug
Browse files
app.py
CHANGED
@@ -193,9 +193,10 @@ def synthesize(model_name, text, speed, voice_audio = None, progress=gr.Progress
|
|
193 |
s_prev = torch.tensor([[0]])
|
194 |
result_wav = []
|
195 |
for t in progress.tqdm(split_to_parts(text)):
|
|
|
|
|
|
|
196 |
if t:
|
197 |
-
t = t.strip()
|
198 |
-
t = t.replace('"', '')
|
199 |
t = t.replace('+', 'ˈ')
|
200 |
t = normalize('NFKC', t)
|
201 |
|
@@ -204,9 +205,9 @@ def synthesize(model_name, text, speed, voice_audio = None, progress=gr.Progress
|
|
204 |
ps = ipa(stressify(t))
|
205 |
|
206 |
tokens = textclenaer(ps)
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
|
211 |
|
212 |
return 24000, torch.concatenate(result_wav).cpu().numpy()
|
|
|
193 |
s_prev = torch.tensor([[0]])
|
194 |
result_wav = []
|
195 |
for t in progress.tqdm(split_to_parts(text)):
|
196 |
+
|
197 |
+
t = t.strip()
|
198 |
+
t = t.replace('"', '')
|
199 |
if t:
|
|
|
|
|
200 |
t = t.replace('+', 'ˈ')
|
201 |
t = normalize('NFKC', t)
|
202 |
|
|
|
205 |
ps = ipa(stressify(t))
|
206 |
|
207 |
tokens = textclenaer(ps)
|
208 |
+
if tokens:
|
209 |
+
wav, s_prev = models[model_name](torch.LongTensor(tokens), voice=voice, speed=speed, diffusion_steps=diffusion_steps, s_prev=s_prev)
|
210 |
+
result_wav.append(wav)
|
211 |
|
212 |
|
213 |
return 24000, torch.concatenate(result_wav).cpu().numpy()
|