harryjulian commited on
Commit
ad0617c
·
1 Parent(s): 3f3d89a

cuda + default

Browse files
Files changed (1) hide show
  1. app.py +16 -6
app.py CHANGED
@@ -5,12 +5,15 @@ sys.path.append("neutts-air")
5
  from neuttsair.neutts import NeuTTSAir
6
  import gradio as gr
7
 
8
- # load model
 
 
 
9
  tts = NeuTTSAir(
10
  backbone_repo="neuphonic/neutts-air",
11
- backbone_device="cpu",
12
  codec_repo="neuphonic/neucodec",
13
- codec_device="cpu"
14
  )
15
 
16
  @spaces.GPU()
@@ -28,11 +31,18 @@ def infer(ref_text, ref_audio_path, gen_text):
28
  demo = gr.Interface(
29
  fn=infer,
30
  inputs=[
31
- gr.Textbox(label="Reference Text", value="So I'm live on radio. And I say, well, my dear friend James here clearly, and the whole room just froze. Turns out I'd completely misspoken and mentioned our other friend."),
32
- gr.Audio(type="filepath", label="Reference Audio", value=os.path.join(os.getcwd(), "/neutts-air/samples/dave.wav")),
33
- gr.Textbox(label="Text to Generate", value="My name is Dave, and um, I'm from London."),
34
  ],
35
  outputs=gr.Audio(type="numpy", label="Generated Speech"),
 
 
 
 
 
 
 
36
  title="NeuTTS-Air☁️",
37
  description="Upload a reference audio sample, provide the reference text, and enter new text to synthesize."
38
  )
 
5
  from neuttsair.neutts import NeuTTSAir
6
  import gradio as gr
7
 
8
+ DEFAULT_REF_TEXT = "So I'm live on radio. And I say, well, my dear friend James here clearly, and the whole room just froze. Turns out I'd completely misspoken and mentioned our other friend."
9
+ DEFAULT_REF_PATH = os.path.join(os.getcwd(), "/neutts-air/samples/dave.wav")
10
+ DEFAULT_GEN_TEXT = "Hello, I'm NeuTTS-Air! How're you doing today?"
11
+
12
  tts = NeuTTSAir(
13
  backbone_repo="neuphonic/neutts-air",
14
+ backbone_device="cuda",
15
  codec_repo="neuphonic/neucodec",
16
+ codec_device="cuda"
17
  )
18
 
19
  @spaces.GPU()
 
31
  demo = gr.Interface(
32
  fn=infer,
33
  inputs=[
34
+ gr.Textbox(label="Reference Text"),
35
+ gr.Audio(type="filepath", label="Reference Audio"),
36
+ gr.Textbox(label="Text to Generate"),
37
  ],
38
  outputs=gr.Audio(type="numpy", label="Generated Speech"),
39
+ examples=[
40
+ [
41
+ DEFAULT_REF_TEXT,
42
+ DEFAULT_REF_PATH,
43
+ DEFAULT_GEN_TEXT
44
+ ],
45
+ ],
46
  title="NeuTTS-Air☁️",
47
  description="Upload a reference audio sample, provide the reference text, and enter new text to synthesize."
48
  )