Spaces:
Runtime error
Runtime error
Duplicate from coqui/xtts
Browse filesCo-authored-by: Vaibhav Srivastav <[email protected]>
- .gitattributes +36 -0
- README.md +15 -0
- app.py +120 -0
- examples/.DS_Store +0 -0
- examples/female.wav +3 -0
- examples/male.wav +3 -0
- requirements.txt +1 -0
.gitattributes
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
examples/female.wav filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: XTTS
|
3 |
+
emoji: 🐸
|
4 |
+
colorFrom: green
|
5 |
+
colorTo: red
|
6 |
+
sdk: gradio
|
7 |
+
sdk_version: 3.44.2
|
8 |
+
app_file: app.py
|
9 |
+
pinned: false
|
10 |
+
models:
|
11 |
+
- coqui/XTTS-v1
|
12 |
+
duplicated_from: coqui/xtts
|
13 |
+
---
|
14 |
+
|
15 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from TTS.api import TTS
|
3 |
+
|
4 |
+
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v1")
|
5 |
+
tts.to("cuda")
|
6 |
+
|
7 |
+
|
8 |
+
def predict(prompt, language, audio_file_pth, agree):
|
9 |
+
if agree == True:
|
10 |
+
tts.tts_to_file(
|
11 |
+
text=prompt,
|
12 |
+
file_path="output.wav",
|
13 |
+
speaker_wav=audio_file_pth,
|
14 |
+
language=language,
|
15 |
+
)
|
16 |
+
|
17 |
+
return (
|
18 |
+
gr.make_waveform(
|
19 |
+
audio="output.wav",
|
20 |
+
),
|
21 |
+
"output.wav",
|
22 |
+
)
|
23 |
+
else:
|
24 |
+
gr.Warning("Please accept the Terms & Condition!")
|
25 |
+
|
26 |
+
|
27 |
+
title = "Coqui🐸 XTTS"
|
28 |
+
|
29 |
+
description = """
|
30 |
+
<a href="https://huggingface.co/coqui/XTTS-v1">XTTS</a> is a Voice generation model that lets you clone voices into different languages by using just a quick 3-second audio clip.
|
31 |
+
<br/>
|
32 |
+
Built on Tortoise, XTTS has important model changes that make cross-language voice cloning and multi-lingual speech generation super easy.
|
33 |
+
<br/>
|
34 |
+
This is the same model that powers Coqui Studio, and Coqui API, however we apply a few tricks to make it faster and support streaming inference.
|
35 |
+
<br/>
|
36 |
+
<br/>
|
37 |
+
<p>For faster inference without waiting in the queue, you should duplicate this space and upgrade to GPU via the settings.
|
38 |
+
<br/>
|
39 |
+
<a href="https://huggingface.co/spaces/coqui/xtts?duplicate=true">
|
40 |
+
<img style="margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>
|
41 |
+
</p>
|
42 |
+
"""
|
43 |
+
|
44 |
+
article = """
|
45 |
+
<div style='margin:20px auto;'>
|
46 |
+
<p>By using this demo you agree to the terms of the Coqui Public Model License at https://coqui.ai/cpml</p>
|
47 |
+
</div>
|
48 |
+
"""
|
49 |
+
|
50 |
+
examples = [
|
51 |
+
[
|
52 |
+
"Once when I was six years old I saw a magnificent picture.",
|
53 |
+
"en",
|
54 |
+
"examples/female.wav",
|
55 |
+
True,
|
56 |
+
],
|
57 |
+
[
|
58 |
+
"Lorsque j'avais six ans j'ai vu, une fois, une magnifique image.",
|
59 |
+
"fr",
|
60 |
+
"examples/male.wav",
|
61 |
+
True,
|
62 |
+
],
|
63 |
+
[
|
64 |
+
"Un tempo lontano, quando avevo sei anni, vidi un magnifico disegno.",
|
65 |
+
"it",
|
66 |
+
"examples/female.wav",
|
67 |
+
True,
|
68 |
+
],
|
69 |
+
]
|
70 |
+
|
71 |
+
gr.Interface(
|
72 |
+
fn=predict,
|
73 |
+
inputs=[
|
74 |
+
gr.Textbox(
|
75 |
+
label="Text Prompt",
|
76 |
+
info="One or two sentences at a time is better",
|
77 |
+
value="It took me quite a long time to develop a voice, and now that I have it I'm not going to be silent.",
|
78 |
+
),
|
79 |
+
gr.Dropdown(
|
80 |
+
label="Language",
|
81 |
+
info="Select an output language for the synthesised speech",
|
82 |
+
choices=[
|
83 |
+
"en",
|
84 |
+
"es",
|
85 |
+
"fr",
|
86 |
+
"de",
|
87 |
+
"it",
|
88 |
+
"pt",
|
89 |
+
"pl",
|
90 |
+
"tr",
|
91 |
+
"ru",
|
92 |
+
"nl",
|
93 |
+
"cz",
|
94 |
+
"ar",
|
95 |
+
"zh-cn",
|
96 |
+
],
|
97 |
+
max_choices=1,
|
98 |
+
value="en",
|
99 |
+
),
|
100 |
+
gr.Audio(
|
101 |
+
label="Reference Audio",
|
102 |
+
info="Click on the ✎ button to upload your own target speaker audio",
|
103 |
+
type="filepath",
|
104 |
+
value="examples/female.wav",
|
105 |
+
),
|
106 |
+
gr.Checkbox(
|
107 |
+
label="Agree",
|
108 |
+
value=False,
|
109 |
+
info="I agree to the terms of the Coqui Public Model License at https://coqui.ai/cpml",
|
110 |
+
),
|
111 |
+
],
|
112 |
+
outputs=[
|
113 |
+
gr.Video(label="Waveform Visual"),
|
114 |
+
gr.Audio(label="Synthesised Audio"),
|
115 |
+
],
|
116 |
+
title=title,
|
117 |
+
description=description,
|
118 |
+
article=article,
|
119 |
+
examples=examples,
|
120 |
+
).queue().launch(debug=True)
|
examples/.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
examples/female.wav
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:89a4fa9a16b6463f852cf9424f72c3d3c87aa83010e89db534c53fcd1ae12c02
|
3 |
+
size 1002030
|
examples/male.wav
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:937c74afad004937e00d1687c68e02210e0c5d93ac072a7c8aeb9ab573517bb1
|
3 |
+
size 762126
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
TTS
|