Spaces:
Runtime error
Runtime error
Commit ·
4d7193b
1
Parent(s): 4b9d080
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
|
|
| 1 |
import os
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
|
|
|
|
| 8 |
|
| 9 |
-
|
| 10 |
-
assert isinstance(text, str) and len(text) > 0, 'Input Chinese text...'
|
| 11 |
-
wav_file = tts_executor(text=text)
|
| 12 |
-
return wav_file
|
| 13 |
|
|
|
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
import os
|
| 3 |
|
| 4 |
+
def inference(text):
|
| 5 |
+
os.system("paddlespeech tts --input '"+text+"' --output output.wav")
|
| 6 |
+
return "output.wav"
|
| 7 |
|
| 8 |
+
title = "Algmon Speech TTS"
|
| 9 |
|
| 10 |
+
description = "Gradio demo for Algmon Speech: A Speech Toolkit based on PaddlePaddle for TTS. To use it, simply add your text, or click one of the examples to load them. Read more at the links below."
|
| 11 |
|
| 12 |
+
article = "<p style='text-align: center'><a href='' target='_blank'>Git Repo</a></p>"
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
examples=[['你好,欢迎使用Algmon语音合成']]
|
| 15 |
|
| 16 |
+
gr.Interface(
|
| 17 |
+
inference,
|
| 18 |
+
gr.inputs.Textbox(label="input text",lines=10),
|
| 19 |
+
gr.outputs.Audio(type="file", label="Output"),
|
| 20 |
+
title=title,
|
| 21 |
+
description=description,
|
| 22 |
+
article=article,
|
| 23 |
+
enable_queue=True,
|
| 24 |
+
examples=examples
|
| 25 |
+
).launch(debug=True)
|