Spaces:
Running
on
T4
Running
on
T4
mrfakename
commited on
Commit
•
70cbf96
1
Parent(s):
b8e3b39
Update app.py
Browse files
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
|
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('
|
53 |
-
|
54 |
-
|
55 |
-
|
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 |
|
|
|
|