Pranjal12345 commited on
Commit
1d9f047
·
1 Parent(s): b38366a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -17,6 +17,7 @@ VOICE_OPTIONS = [
17
  def inference(
18
  text,
19
  voice,
 
20
  ):
21
 
22
  texts = [text]
@@ -35,7 +36,7 @@ def inference(
35
  text,
36
  voice_samples=voice_samples,
37
  conditioning_latents=conditioning_latents,
38
- preset="ultra_fast",
39
  k=1
40
  ):
41
  yield (24000, audio_frame.cpu().detach().numpy())
@@ -52,12 +53,20 @@ def main():
52
  VOICE_OPTIONS, value="jane_eyre", label="Select voice:", type="value"
53
  )
54
 
 
 
 
 
 
 
 
55
  output_audio = gr.Audio(label="streaming audio:", streaming=True, autoplay=True)
56
  interface = gr.Interface(
57
  fn=inference,
58
  inputs=[
59
  text,
60
  voice,
 
61
  ],
62
  title=title,
63
  outputs=[output_audio],
 
17
  def inference(
18
  text,
19
  voice,
20
+ preset_option,
21
  ):
22
 
23
  texts = [text]
 
36
  text,
37
  voice_samples=voice_samples,
38
  conditioning_latents=conditioning_latents,
39
+ preset= preset_option,
40
  k=1
41
  ):
42
  yield (24000, audio_frame.cpu().detach().numpy())
 
53
  VOICE_OPTIONS, value="jane_eyre", label="Select voice:", type="value"
54
  )
55
 
56
+ preset_option = gr.Radio(
57
+ ["ultra_fast", "fast", "standard", "high_quality"],
58
+ label="ultra_fast for quick inference and high_quality for better inference",
59
+ type="value",
60
+ value="ultra_fast",
61
+ )
62
+
63
  output_audio = gr.Audio(label="streaming audio:", streaming=True, autoplay=True)
64
  interface = gr.Interface(
65
  fn=inference,
66
  inputs=[
67
  text,
68
  voice,
69
+ preset_option,
70
  ],
71
  title=title,
72
  outputs=[output_audio],