Update app.py
Browse files
app.py
CHANGED
@@ -60,8 +60,8 @@ def generate_audio(text, model_id, language):
|
|
60 |
output = pipe_dict["original_pipe"](text)
|
61 |
output = gr.Audio(value = (output["sampling_rate"], output["audio"].squeeze()), type="numpy", autoplay=True, label=f"Finetuned model prediction {default_model_per_language[language]}", show_label=True,
|
62 |
visible=True)
|
63 |
-
|
64 |
-
out.extend([gr.Audio(visible=False)])
|
65 |
|
66 |
# if num_speakers>1:
|
67 |
# for i in range(min(num_speakers, max_speakers - 1)):
|
@@ -78,7 +78,7 @@ def generate_audio(text, model_id, language):
|
|
78 |
# visible=True)
|
79 |
# out.append(output)
|
80 |
# out.extend([gr.Audio(visible=False)]*(max_speakers-2))
|
81 |
-
return
|
82 |
|
83 |
|
84 |
css = """
|
@@ -115,10 +115,7 @@ with gr.Blocks(css=css) as demo_blocks:
|
|
115 |
)
|
116 |
|
117 |
with gr.Column():
|
118 |
-
|
119 |
-
for i in range(max_speakers):
|
120 |
-
out_audio = gr.Audio(type="numpy", autoplay=False, label=f"Generated Audio - speaker {i}", show_label=True, visible=False)
|
121 |
-
outputs.append(out_audio)
|
122 |
|
123 |
with gr.Accordion("Datasets and models details", open=False):
|
124 |
gr.Markdown("""
|
@@ -140,7 +137,7 @@ with gr.Blocks(css=css) as demo_blocks:
|
|
140 |
model_id
|
141 |
)
|
142 |
|
143 |
-
btn.click(generate_audio, [inp_text, model_id, language],
|
144 |
|
145 |
|
146 |
demo_blocks.queue().launch()
|
|
|
60 |
output = pipe_dict["original_pipe"](text)
|
61 |
output = gr.Audio(value = (output["sampling_rate"], output["audio"].squeeze()), type="numpy", autoplay=True, label=f"Finetuned model prediction {default_model_per_language[language]}", show_label=True,
|
62 |
visible=True)
|
63 |
+
|
64 |
+
# out.extend([gr.Audio(visible=False)])
|
65 |
|
66 |
# if num_speakers>1:
|
67 |
# for i in range(min(num_speakers, max_speakers - 1)):
|
|
|
78 |
# visible=True)
|
79 |
# out.append(output)
|
80 |
# out.extend([gr.Audio(visible=False)]*(max_speakers-2))
|
81 |
+
return output
|
82 |
|
83 |
|
84 |
css = """
|
|
|
115 |
)
|
116 |
|
117 |
with gr.Column():
|
118 |
+
output = gr.Audio(type="numpy", autoplay=False, label=f"Generated Audio - speaker {i}", show_label=True, visible=False)
|
|
|
|
|
|
|
119 |
|
120 |
with gr.Accordion("Datasets and models details", open=False):
|
121 |
gr.Markdown("""
|
|
|
137 |
model_id
|
138 |
)
|
139 |
|
140 |
+
btn.click(generate_audio, [inp_text, model_id, language], output)
|
141 |
|
142 |
|
143 |
demo_blocks.queue().launch()
|