mrfakename commited on
Commit
5cadb57
·
verified ·
1 Parent(s): bb5c0e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -77,7 +77,7 @@ def synthesize(text, voice, lngsteps, password, progress=gr.Progress()):
77
  # return (24000, np.concatenate(audios))
78
  # else:
79
  # raise gr.Error('Wrong access code')
80
- def clsynthesize(text, voice, vcsteps, embscale, alpha, beta, progress=gr.Progress()):
81
  # if text.strip() == "":
82
  # raise gr.Error("You must enter some text")
83
  # # if global_phonemizer.phonemize([text]) > 300:
@@ -103,7 +103,7 @@ def clsynthesize(text, voice, vcsteps, embscale, alpha, beta, progress=gr.Progre
103
  audios.append(styletts2importable.inference(t, vs, alpha=alpha, beta=beta, diffusion_steps=vcsteps, embedding_scale=embscale))
104
  # audios.append(styletts2importable.inference(t, vs, diffusion_steps=10, alpha=0.3, beta=0.7, embedding_scale=5))
105
  return (24000, np.concatenate(audios))
106
- def ljsynthesize(text, steps, progress=gr.Progress()):
107
  # if text.strip() == "":
108
  # raise gr.Error("You must enter some text")
109
  # # if global_phonemizer.phonemize([text]) > 300:
@@ -148,7 +148,7 @@ with gr.Blocks() as clone:
148
  with gr.Column(scale=1):
149
  clbtn = gr.Button("Synthesize", variant="primary")
150
  claudio = gr.Audio(interactive=False, label="Synthesized Audio", waveform_options={'waveform_progress_color': '#3C82F6'})
151
- clbtn.click(clsynthesize, inputs=[clinp, clvoice, vcsteps, embscale, alpha, beta], outputs=[claudio], concurrency_limit=4)
152
  # with gr.Blocks() as longText:
153
  # with gr.Row():
154
  # with gr.Column(scale=1):
@@ -168,7 +168,7 @@ with gr.Blocks() as lj:
168
  with gr.Column(scale=1):
169
  ljbtn = gr.Button("Synthesize", variant="primary")
170
  ljaudio = gr.Audio(interactive=False, label="Synthesized Audio", waveform_options={'waveform_progress_color': '#3C82F6'})
171
- ljbtn.click(ljsynthesize, inputs=[ljinp, ljsteps], outputs=[ljaudio], concurrency_limit=4)
172
  with gr.Blocks(title="StyleTTS 2", css="footer{display:none !important}", theme=theme) as demo:
173
  gr.Markdown(INTROTXT)
174
  gr.DuplicateButton("Duplicate Space")
 
77
  # return (24000, np.concatenate(audios))
78
  # else:
79
  # raise gr.Error('Wrong access code')
80
+ def rn_clsynthesize(text, voice, vcsteps, embscale, alpha, beta, progress=gr.Progress()):
81
  # if text.strip() == "":
82
  # raise gr.Error("You must enter some text")
83
  # # if global_phonemizer.phonemize([text]) > 300:
 
103
  audios.append(styletts2importable.inference(t, vs, alpha=alpha, beta=beta, diffusion_steps=vcsteps, embedding_scale=embscale))
104
  # audios.append(styletts2importable.inference(t, vs, diffusion_steps=10, alpha=0.3, beta=0.7, embedding_scale=5))
105
  return (24000, np.concatenate(audios))
106
+ def rn_ljsynthesize(text, steps, progress=gr.Progress()):
107
  # if text.strip() == "":
108
  # raise gr.Error("You must enter some text")
109
  # # if global_phonemizer.phonemize([text]) > 300:
 
148
  with gr.Column(scale=1):
149
  clbtn = gr.Button("Synthesize", variant="primary")
150
  claudio = gr.Audio(interactive=False, label="Synthesized Audio", waveform_options={'waveform_progress_color': '#3C82F6'})
151
+ clbtn.click(rn_clsynthesize, inputs=[clinp, clvoice, vcsteps, embscale, alpha, beta], outputs=[claudio], concurrency_limit=4)
152
  # with gr.Blocks() as longText:
153
  # with gr.Row():
154
  # with gr.Column(scale=1):
 
168
  with gr.Column(scale=1):
169
  ljbtn = gr.Button("Synthesize", variant="primary")
170
  ljaudio = gr.Audio(interactive=False, label="Synthesized Audio", waveform_options={'waveform_progress_color': '#3C82F6'})
171
+ ljbtn.click(rn_ljsynthesize, inputs=[ljinp, ljsteps], outputs=[ljaudio], concurrency_limit=4)
172
  with gr.Blocks(title="StyleTTS 2", css="footer{display:none !important}", theme=theme) as demo:
173
  gr.Markdown(INTROTXT)
174
  gr.DuplicateButton("Duplicate Space")