Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -38,6 +38,9 @@ def show_error(text):
|
|
38 |
else:
|
39 |
return gr.update(visible=False), gr.update(visible=True)
|
40 |
|
|
|
|
|
|
|
41 |
title = "Voice-Cloning-Demo"
|
42 |
|
43 |
def toggle(choice):
|
@@ -67,13 +70,14 @@ with gr.Blocks(css=css) as demo:
|
|
67 |
btn = gr.Button("Submit", variant="primary")
|
68 |
with gr.Column():
|
69 |
audio_output = gr.Audio(label="Output", visible=True)
|
70 |
-
error_box = gr.Textbox(label="
|
71 |
|
72 |
# gr.Examples(examples, fn=inference, inputs=[audio_file, text_input],
|
73 |
# outputs=audio_output, cache_examples=True)
|
74 |
btn.click(text_to_speech, inputs=[text_input, audio_input_mic, audio_input_file], outputs=audio_output)
|
75 |
btn.click(show_error, text_input, [error_box, audio_output])
|
76 |
radio.change(toggle, radio, [audio_input_mic, audio_input_file])
|
|
|
77 |
btn_clear.add(audio_output)
|
78 |
btn.click(change_color, text_input, text_input)
|
79 |
|
|
|
38 |
else:
|
39 |
return gr.update(visible=False), gr.update(visible=True)
|
40 |
|
41 |
+
def clear_color(text_input, radio):
|
42 |
+
return gr.update(elem_id="alert"), gr.update(value="mic")
|
43 |
+
|
44 |
title = "Voice-Cloning-Demo"
|
45 |
|
46 |
def toggle(choice):
|
|
|
70 |
btn = gr.Button("Submit", variant="primary")
|
71 |
with gr.Column():
|
72 |
audio_output = gr.Audio(label="Output", visible=True)
|
73 |
+
error_box = gr.Textbox(label="WARNING", value="Input box cannot be blank!!", visible=False)
|
74 |
|
75 |
# gr.Examples(examples, fn=inference, inputs=[audio_file, text_input],
|
76 |
# outputs=audio_output, cache_examples=True)
|
77 |
btn.click(text_to_speech, inputs=[text_input, audio_input_mic, audio_input_file], outputs=audio_output)
|
78 |
btn.click(show_error, text_input, [error_box, audio_output])
|
79 |
radio.change(toggle, radio, [audio_input_mic, audio_input_file])
|
80 |
+
btn_clear.click(clear_color, [text_input, radio], [text_input, radio])
|
81 |
btn_clear.add(audio_output)
|
82 |
btn.click(change_color, text_input, text_input)
|
83 |
|