VanYsa commited on
Commit
e4337eb
1 Parent(s): d48c017

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -7,14 +7,12 @@ import gradio as gr
7
 
8
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
9
 
10
- pipe_dict = {
11
- "original_pipe": pipeline("text-to-speech", model="kakao-enterprise/vits-ljs", device=device),
12
- }
13
 
14
  # Inference
15
  def generate_audio(text):
16
 
17
- output = pipe_dict["original_pipe"](text)
18
  output = gr.Audio(value = (output["sampling_rate"], output["audio"].squeeze()), type="numpy", autoplay=False, label="Response Voice Player", show_label=True,
19
  visible=True)
20
 
@@ -43,7 +41,7 @@ with gr.Blocks(css=css) as demo_blocks:
43
 
44
 
45
  with gr.Column():
46
- out_audio = gr.Audio(type="numpy", autoplay=False, label="Generated Audio - British Female Speaker", show_label=True, visible=False)
47
 
48
  btn.click(generate_audio, [inp_text], out_audio)
49
 
 
7
 
8
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
9
 
10
+ pipe = pipeline("text-to-speech", model="kakao-enterprise/vits-ljs", device=device)
 
 
11
 
12
  # Inference
13
  def generate_audio(text):
14
 
15
+ output = pipe(text)
16
  output = gr.Audio(value = (output["sampling_rate"], output["audio"].squeeze()), type="numpy", autoplay=False, label="Response Voice Player", show_label=True,
17
  visible=True)
18
 
 
41
 
42
 
43
  with gr.Column():
44
+ out_audio = gr.Audio(type="numpy", autoplay=True, label="Generated Audio - British Female Speaker", show_label=True, visible=True)
45
 
46
  btn.click(generate_audio, [inp_text], out_audio)
47