mrfakename Pendrokar commited on
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 <Pendrokar@users.noreply.huggingface.co>

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -27,7 +27,7 @@ default_text_dict = {
27
  'KR': '์ตœ๊ทผ ํ…์ŠคํŠธ ์Œ์„ฑ ๋ณ€ํ™˜ ๋ถ„์•ผ๊ฐ€ ๊ธ‰์†๋„๋กœ ๋ฐœ์ „ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.',
28
  }
29
 
30
- def synthesize(speaker, text, 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,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=[speaker, text, speed, language], outputs=[aud])
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