arifather51 commited on
Commit
4f59883
·
verified ·
1 Parent(s): f40be3f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -23
app.py CHANGED
@@ -1,12 +1,11 @@
1
  import spaces
2
  import gradio as gr
3
- import torch
4
  from TTS.api import TTS
5
  import os
6
 
7
  os.environ["COQUI_TOS_AGREED"] = "1"
8
 
9
- device = "cpu" # CPU-only HuggingFace Space
10
 
11
  tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)
12
 
@@ -17,28 +16,9 @@ def clone(text, audio):
17
 
18
  iface = gr.Interface(
19
  fn=clone,
20
- inputs=[
21
- gr.Textbox(label='Text'),
22
- gr.Audio(type='filepath', label='Voice reference audio file')
23
- ],
24
  outputs=gr.Audio(type='filepath'),
25
  title='Voice Clone',
26
- description="""
27
- by [Tony Assi](https://www.tonyassi.com/)
28
- ---
29
- ### If you like voice clone then try [Video Face Swap](https://huggingface.co/spaces/tonyassi/video-face-swap)!
30
- ---
31
- This space uses xtts_v2 model. Non-commercial use only. [Coqui Public Model License](https://coqui.ai/cpml)
32
- Please ❤️ this Space. <a href="mailto: tony.assi.media@gmail.com">Email me</a>.
33
- """,
34
- theme=gr.themes.Base(primary_hue="teal", secondary_hue="teal", neutral_hue="slate"),
35
- examples=[
36
- ["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"],
37
- ["It's me Vito Corleone, from the Godfather. Type in whatever you'd like me to say.","./audio/Godfather.wav"],
38
- ["Hey, it's me Paris Hilton. Type in whatever you'd like me to say.","./audio/Paris-Hilton.mp3"],
39
- ["Hey, it's me Megan Fox from Transformers. Type in whatever you'd like me to say.","./audio/Megan-Fox.mp3"],
40
- ["Hey there, it's me Jeff Goldblum. Type in whatever you'd like me to say.","./audio/Jeff-Goldblum.mp3"],
41
- ["Hey there, it's me Heath Ledger as the Joker. Type in whatever you'd like me to say.","./audio/Heath-Ledger.mp3"],
42
- ]
43
  )
44
  iface.launch()
 
1
  import spaces
2
  import gradio as gr
 
3
  from TTS.api import TTS
4
  import os
5
 
6
  os.environ["COQUI_TOS_AGREED"] = "1"
7
 
8
+ device = "cpu"
9
 
10
  tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)
11
 
 
16
 
17
  iface = gr.Interface(
18
  fn=clone,
19
+ inputs=[gr.Textbox(label='Text'), gr.Audio(type='filepath', label='Voice reference audio file')],
 
 
 
20
  outputs=gr.Audio(type='filepath'),
21
  title='Voice Clone',
22
+ description="by Tony Assi — CPU-only version",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  )
24
  iface.launch()