Spaces:
Runtime error
Runtime error
Fixed stoks padding
Browse filesThis fixes the strange vocalizations at the end of many generations
app.py
CHANGED
@@ -80,7 +80,8 @@ def generate_audio(pipe, segments, speaker, speaker_url, cps=14):
|
|
80 |
else: speaker = pipe.default_speaker
|
81 |
langs, texts = [list(x) for x in zip(*segments)]
|
82 |
print(texts, langs)
|
83 |
-
stoks = pipe.t2s.generate(texts, cps=cps, lang=langs)
|
|
|
84 |
atoks = pipe.s2a.generate(stoks, speaker.unsqueeze(0))
|
85 |
audio = pipe.vocoder.decode(atoks)
|
86 |
return audio.cpu()
|
|
|
80 |
else: speaker = pipe.default_speaker
|
81 |
langs, texts = [list(x) for x in zip(*segments)]
|
82 |
print(texts, langs)
|
83 |
+
stoks = pipe.t2s.generate(texts, cps=cps, lang=langs)
|
84 |
+
stoks = stoks[stoks!=512]
|
85 |
atoks = pipe.s2a.generate(stoks, speaker.unsqueeze(0))
|
86 |
audio = pipe.vocoder.decode(atoks)
|
87 |
return audio.cpu()
|