mrfakename commited on
Commit
70cbf96
1 Parent(s): b8e3b39

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -11
app.py CHANGED
@@ -7,7 +7,6 @@ os.system('python -m unidic download')
7
  from melo.api import TTS
8
  speed = 1.0
9
  import tempfile
10
- import click
11
  device = 'cuda'
12
  models = {
13
  'EN': TTS(language='EN', device=device),
@@ -39,7 +38,7 @@ def load_speakers(language, text):
39
  newtext = text
40
  return gr.update(value=list(models[language].hps.data.spk2id.keys())[0], choices=list(models[language].hps.data.spk2id.keys())), newtext
41
  with gr.Blocks() as demo:
42
- gr.Markdown('# MeloTTS WebUI\n\nA WebUI for MeloTTS.')
43
  with gr.Group():
44
  speaker = gr.Dropdown(speaker_ids.keys(), interactive=True, value='EN-US', label='Speaker')
45
  language = gr.Radio(['EN', 'ES', 'FR', 'ZH', 'JP', 'KR'], label='Language', value='EN')
@@ -49,13 +48,8 @@ with gr.Blocks() as demo:
49
  btn = gr.Button('Synthesize', variant='primary')
50
  aud = gr.Audio(interactive=False)
51
  btn.click(synthesize, inputs=[speaker, text, speed, language], outputs=[aud])
52
- gr.Markdown('WebUI by [mrfakename](https://twitter.com/realmrfakename).')
53
- @click.command()
54
- @click.option('--share', '-s', is_flag=True, show_default=True, default=False, help="Expose a publicly-accessible shared Gradio link usable by anyone with the link. Only share the link with people you trust.")
55
- @click.option('--host', '-h', default=None)
56
- @click.option('--port', '-p', default=None)
57
- def main(share, host, port):
58
- demo.queue(api_open=False, default_concurrency_limit=10).launch(show_api=False, share=share, server_name=host, server_port=port)
59
 
60
- if __name__ == "__main__":
61
- main()
 
7
  from melo.api import TTS
8
  speed = 1.0
9
  import tempfile
 
10
  device = 'cuda'
11
  models = {
12
  'EN': TTS(language='EN', device=device),
 
38
  newtext = text
39
  return gr.update(value=list(models[language].hps.data.spk2id.keys())[0], choices=list(models[language].hps.data.spk2id.keys())), newtext
40
  with gr.Blocks() as demo:
41
+ gr.Markdown('# MeloTTS Demo\n\nAn unofficial for [MeloTTS](https://github.com/myshell-ai/MeloTTS).')
42
  with gr.Group():
43
  speaker = gr.Dropdown(speaker_ids.keys(), interactive=True, value='EN-US', label='Speaker')
44
  language = gr.Radio(['EN', 'ES', 'FR', 'ZH', 'JP', 'KR'], label='Language', value='EN')
 
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
+
54
+ demo.queue(api_open=False, default_concurrency_limit=10).launch(show_api=False, share=share, server_name=host, server_port=port)
 
 
 
55