Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,12 +10,16 @@ device = "cuda"
|
|
10 |
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)
|
11 |
|
12 |
@spaces.GPU(enable_queue=True)
|
13 |
-
def clone(text, audio):
|
14 |
-
tts.tts_to_file(text=text, speaker_wav=audio, language=
|
15 |
return "./output.wav"
|
16 |
|
17 |
iface = gr.Interface(fn=clone,
|
18 |
-
inputs=[
|
|
|
|
|
|
|
|
|
19 |
outputs=gr.Audio(type='filepath'),
|
20 |
title='Voice Clone',
|
21 |
description="""
|
@@ -25,10 +29,10 @@ iface = gr.Interface(fn=clone,
|
|
25 |
Please ❤️ this Space. <a href="mailto: [email protected]">Email me</a>.
|
26 |
""",
|
27 |
theme = gr.themes.Base(primary_hue="teal",secondary_hue="teal",neutral_hue="slate"),
|
28 |
-
examples=[["Hey! It's me Dorthy, from the Wizard of Oz. Type in whatever you'd like me to say.","./audio/Wizard-of-Oz-Dorthy.wav"],
|
29 |
-
["It's me Vito Corleone, from the Godfather. Type in whatever you'd like me to say.","./audio/Godfather.wav"],
|
30 |
-
["Hey, it's me Paris Hilton. Type in whatever you'd like me to say.","./audio/Paris-Hilton.mp3"],
|
31 |
-
["Hey, it's me Megan Fox from Transformers. Type in whatever you'd like me to say.","./audio/Megan-Fox.mp3"],
|
32 |
-
["Hey there, it's me Jeff Goldblum. Type in whatever you'd like me to say.","./audio/Jeff-Goldblum.mp3"],
|
33 |
-
["Hey there, it's me Heath Ledger as the Joker. Type in whatever you'd like me to say.","./audio/Heath-Ledger.mp3"],])
|
34 |
iface.launch()
|
|
|
10 |
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)
|
11 |
|
12 |
@spaces.GPU(enable_queue=True)
|
13 |
+
def clone(text, audio, language):
|
14 |
+
tts.tts_to_file(text=text, speaker_wav=audio, language=language, file_path="./output.wav")
|
15 |
return "./output.wav"
|
16 |
|
17 |
iface = gr.Interface(fn=clone,
|
18 |
+
inputs=[
|
19 |
+
gr.Textbox(label='Text'),
|
20 |
+
gr.Audio(type='filepath', label='Voice reference audio file'),
|
21 |
+
gr.Dropdown(label="Language", choices=["en", "es", "pt-br"], value="en")
|
22 |
+
],
|
23 |
outputs=gr.Audio(type='filepath'),
|
24 |
title='Voice Clone',
|
25 |
description="""
|
|
|
29 |
Please ❤️ this Space. <a href="mailto: [email protected]">Email me</a>.
|
30 |
""",
|
31 |
theme = gr.themes.Base(primary_hue="teal",secondary_hue="teal",neutral_hue="slate"),
|
32 |
+
examples=[["Hey! It's me Dorthy, from the Wizard of Oz. Type in whatever you'd like me to say.","./audio/Wizard-of-Oz-Dorthy.wav", "en"],
|
33 |
+
["It's me Vito Corleone, from the Godfather. Type in whatever you'd like me to say.","./audio/Godfather.wav", "en"],
|
34 |
+
["Hey, it's me Paris Hilton. Type in whatever you'd like me to say.","./audio/Paris-Hilton.mp3", "en"],
|
35 |
+
["Hey, it's me Megan Fox from Transformers. Type in whatever you'd like me to say.","./audio/Megan-Fox.mp3", "en"],
|
36 |
+
["Hey there, it's me Jeff Goldblum. Type in whatever you'd like me to say.","./audio/Jeff-Goldblum.mp3", "en"],
|
37 |
+
["Hey there, it's me Heath Ledger as the Joker. Type in whatever you'd like me to say.","./audio/Heath-Ledger.mp3", "en"],])
|
38 |
iface.launch()
|