Spaces:
Runtime error
Runtime error
- app.py +20 -0
- packages.txt +0 -5
app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
+
import gradio as gr
|
4 |
+
from paddlespeech.cli import TTSExecutor
|
5 |
+
|
6 |
+
tts_executor = TTSExecutor()
|
7 |
+
|
8 |
+
|
9 |
+
def speech_generate(text: str) -> os.PathLike:
|
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 |
+
iface = gr.Interface(
|
16 |
+
fn=speech_generate,
|
17 |
+
inputs=gr.inputs.Textbox(placeholder='请输入文字...'),
|
18 |
+
outputs=gr.outputs.Audio(),
|
19 |
+
)
|
20 |
+
iface.launch()
|
packages.txt
CHANGED
@@ -1,5 +0,0 @@
|
|
1 |
-
libsndfile1
|
2 |
-
sox
|
3 |
-
ffmpeg
|
4 |
-
libsm6
|
5 |
-
libxext6
|
|
|
|
|
|
|
|
|
|
|
|