Spaces:
Running
on
T4
Running
on
T4
Commit
โข
e04b055
1
Parent(s):
245eecf
API: first and secondary argument position switch (#6)
Browse files- API: first and secondary argument position switch (c87dd95550e3af4fe91b50e32a779052a3a21d5d)
Co-authored-by: Yanis L <[email protected]>
app.py
CHANGED
@@ -27,7 +27,7 @@ default_text_dict = {
|
|
27 |
'KR': '์ต๊ทผ ํ
์คํธ ์์ฑ ๋ณํ ๋ถ์ผ๊ฐ ๊ธ์๋๋ก ๋ฐ์ ํ๊ณ ์์ต๋๋ค.',
|
28 |
}
|
29 |
|
30 |
-
def synthesize(
|
31 |
bio = io.BytesIO()
|
32 |
models[language].tts_to_file(text, models[language].hps.data.spk2id[speaker], bio, speed=speed, pbar=progress.tqdm, format='wav')
|
33 |
return bio.getvalue()
|
@@ -47,7 +47,7 @@ with gr.Blocks() as demo:
|
|
47 |
language.input(load_speakers, inputs=[language, text], outputs=[speaker, text])
|
48 |
btn = gr.Button('Synthesize', variant='primary')
|
49 |
aud = gr.Audio(interactive=False)
|
50 |
-
btn.click(synthesize, inputs=[
|
51 |
gr.Markdown('Demo by [mrfakename](https://twitter.com/realmrfakename).')
|
52 |
|
53 |
|
|
|
27 |
'KR': '์ต๊ทผ ํ
์คํธ ์์ฑ ๋ณํ ๋ถ์ผ๊ฐ ๊ธ์๋๋ก ๋ฐ์ ํ๊ณ ์์ต๋๋ค.',
|
28 |
}
|
29 |
|
30 |
+
def synthesize(text, speaker, speed, language, progress=gr.Progress()):
|
31 |
bio = io.BytesIO()
|
32 |
models[language].tts_to_file(text, models[language].hps.data.spk2id[speaker], bio, speed=speed, pbar=progress.tqdm, format='wav')
|
33 |
return bio.getvalue()
|
|
|
47 |
language.input(load_speakers, inputs=[language, text], outputs=[speaker, text])
|
48 |
btn = gr.Button('Synthesize', variant='primary')
|
49 |
aud = gr.Audio(interactive=False)
|
50 |
+
btn.click(synthesize, inputs=[text, speaker, speed, language], outputs=[aud])
|
51 |
gr.Markdown('Demo by [mrfakename](https://twitter.com/realmrfakename).')
|
52 |
|
53 |
|