Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ print("import ppn")
|
|
4 |
from pypinyin import lazy_pinyin, Style
|
5 |
print("import torch")
|
6 |
import torch
|
7 |
-
device = 'cuda
|
8 |
print("import ttts")
|
9 |
from ttts.utils.infer_utils import load_model
|
10 |
print("import mel")
|
@@ -84,4 +84,9 @@ def speak(text):
|
|
84 |
|
85 |
with gr.Blocks() as demo:
|
86 |
gr.Markdown('# TTTS\n\nA demo of [TTTS](https://github.com/adelacvg/ttts) based on XTTS. TTTS only supports Chinese.')
|
87 |
-
gr.Textbox(label="Text to say", interactive=True, value="大家好,今天来点大家想看的东西。")
|
|
|
|
|
|
|
|
|
|
|
|
4 |
from pypinyin import lazy_pinyin, Style
|
5 |
print("import torch")
|
6 |
import torch
|
7 |
+
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
8 |
print("import ttts")
|
9 |
from ttts.utils.infer_utils import load_model
|
10 |
print("import mel")
|
|
|
84 |
|
85 |
with gr.Blocks() as demo:
|
86 |
gr.Markdown('# TTTS\n\nA demo of [TTTS](https://github.com/adelacvg/ttts) based on XTTS. TTTS only supports Chinese.')
|
87 |
+
txt = gr.Textbox(label="Text to say", interactive=True, value="大家好,今天来点大家想看的东西。")
|
88 |
+
btn = gr.Button("Say")
|
89 |
+
aud = gr.Audio(interactive=False)
|
90 |
+
btn.click(speak, inputs=txt, outputs=aud)
|
91 |
+
|
92 |
+
demo.launch()
|