Spaces:
Runtime error
Runtime error
Rodrigo Martinez Arzate
commited on
Commit
·
1945c48
1
Parent(s):
529f293
Adding app and requirements
Browse files- app.py +28 -0
- requirements.txt +11 -0
app.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from TTS.tts.configs.xtts_config import XttsConfig
|
3 |
+
from TTS.tts.models.xtts import Xtts
|
4 |
+
|
5 |
+
config = XttsConfig()
|
6 |
+
config.load_json("/model/config.json")
|
7 |
+
model = Xtts.init_from_config(config)
|
8 |
+
model.load_checkpoint(config, checkpoint_dir="/model/", eval=True)
|
9 |
+
model.cuda()
|
10 |
+
|
11 |
+
|
12 |
+
def generateVoice(prompt):
|
13 |
+
outputs = model.synthesize(
|
14 |
+
"It took me quite a long time to develop a voice and now that I have it I am not going to be silent.",
|
15 |
+
config,
|
16 |
+
speaker_wav="/guide_recording/guide.wav",
|
17 |
+
gpt_cond_len=3,
|
18 |
+
language="es",
|
19 |
+
)
|
20 |
+
return outputs
|
21 |
+
|
22 |
+
demo = gr.Interface(
|
23 |
+
fn=generateVoice,
|
24 |
+
inputs=["text"],
|
25 |
+
outputs=["audio"],
|
26 |
+
)
|
27 |
+
|
28 |
+
demo.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
TTS @ git+https://github.com/coqui-ai/TTS@v0.21.1
|
2 |
+
pydantic==1.10.13
|
3 |
+
python-multipart==0.0.6
|
4 |
+
typing-extensions>=4.8.0
|
5 |
+
cutlet
|
6 |
+
mecab-python3==1.0.6
|
7 |
+
unidic-lite==1.0.8
|
8 |
+
unidic==1.1.0
|
9 |
+
langid
|
10 |
+
deepspeed
|
11 |
+
pydub
|