Spaces:
Running
on
Zero
Running
on
Zero
Upload app.py
Browse files
app.py
CHANGED
@@ -197,7 +197,7 @@ def forward(tokens, voice, speed, device='cpu'):
|
|
197 |
def forward_gpu(tokens, voice, speed):
|
198 |
return forward(tokens, voice, speed, device='cuda')
|
199 |
|
200 |
-
def generate(text, voice, ps=None, speed=1, reduce_noise=
|
201 |
if voice not in VOICES:
|
202 |
# Ensure stability for https://huggingface.co/spaces/Pendrokar/TTS-Spaces-Arena
|
203 |
voice = 'af'
|
@@ -274,8 +274,8 @@ with gr.Blocks() as basic_tts:
|
|
274 |
ease_in = gr.Slider(minimum=0, maximum=24000, value=3000, step=1000, label='🎢 Ease In', info='Ease in samples, after opening cut')
|
275 |
with gr.Column():
|
276 |
ease_out = gr.Slider(minimum=0, maximum=24000, value=1000, step=1000, label='🛝 Ease Out', info='Ease out samples, before closing cut')
|
277 |
-
text.submit(generate, inputs=[text, voice, in_ps,
|
278 |
-
generate_btn.click(generate, inputs=[text, voice, in_ps,
|
279 |
|
280 |
@torch.no_grad()
|
281 |
def lf_forward(token_lists, voice, speed, device='cpu'):
|
|
|
197 |
def forward_gpu(tokens, voice, speed):
|
198 |
return forward(tokens, voice, speed, device='cuda')
|
199 |
|
200 |
+
def generate(text, voice, ps=None, speed=1, reduce_noise=0.5, opening_cut=4000, closing_cut=2000, ease_in=3000, ease_out=1000, pad_before=5000, pad_after=5000, use_gpu=None):
|
201 |
if voice not in VOICES:
|
202 |
# Ensure stability for https://huggingface.co/spaces/Pendrokar/TTS-Spaces-Arena
|
203 |
voice = 'af'
|
|
|
274 |
ease_in = gr.Slider(minimum=0, maximum=24000, value=3000, step=1000, label='🎢 Ease In', info='Ease in samples, after opening cut')
|
275 |
with gr.Column():
|
276 |
ease_out = gr.Slider(minimum=0, maximum=24000, value=1000, step=1000, label='🛝 Ease Out', info='Ease out samples, before closing cut')
|
277 |
+
text.submit(generate, inputs=[text, voice, in_ps, 0.5, speed, opening_cut, closing_cut, ease_in, ease_out, 5000, 5000, use_gpu], outputs=[audio, out_ps])
|
278 |
+
generate_btn.click(generate, inputs=[text, voice, in_ps, 0.5, speed, opening_cut, closing_cut, ease_in, ease_out, 5000, 5000, use_gpu], outputs=[audio, out_ps])
|
279 |
|
280 |
@torch.no_grad()
|
281 |
def lf_forward(token_lists, voice, speed, device='cpu'):
|