Skip to content

Commit

Permalink
fix: only include the style reference input if the model supports it
Browse files Browse the repository at this point in the history
  • Loading branch information
roedoejet committed Jan 14, 2025
1 parent f0b96c6 commit db9d967
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions everyvoice/demo/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,6 @@ def create_demo_app(
if model.config.model.use_global_style_token_module:
with gr.Row():
style_reference = gr.Audio(type="filepath")
else:
style_reference = None
btn = gr.Button("Synthesize")
with gr.Column():
out_audio = gr.Audio(format="wav")
Expand All @@ -303,9 +301,17 @@ def create_demo_app(
else:
out_file = gr.File(label="File Output")
outputs = [out_audio, out_file]
inputs = [inp_text, inp_slider, inp_lang, inp_speak, output_format]
# Only include the style reference input if the model supports it
if model.config.model.use_global_style_token_module:
inputs.append(style_reference)
else:
synthesize_audio_preset = partial(
synthesize_audio_preset, style_reference=None
)
btn.click(
synthesize_audio_preset,
inputs=[inp_text, inp_slider, inp_lang, inp_speak, output_format, style_reference],
inputs=inputs,
outputs=[out_audio],
)
return demo

0 comments on commit db9d967

Please sign in to comment.