Update app.py
Browse files
app.py
CHANGED
@@ -47,13 +47,11 @@ with gr.Blocks(theme=gr.themes.Base()) as blocks:
|
|
47 |
def process_and_output(text):
|
48 |
audio, message = synthesize_speech(text)
|
49 |
if message:
|
50 |
-
|
51 |
-
output_audio.update(None)
|
52 |
else:
|
53 |
-
|
54 |
-
output_text.update(None)
|
55 |
|
56 |
submit_button.click(process_and_output, inputs=input_text, outputs=[output_audio, output_text])
|
57 |
|
58 |
# Run the app
|
59 |
-
blocks.launch()
|
|
|
47 |
def process_and_output(text):
|
48 |
audio, message = synthesize_speech(text)
|
49 |
if message:
|
50 |
+
return None, message # Return None for audio and the error message
|
|
|
51 |
else:
|
52 |
+
return audio, None # Return the audio data and None for the message
|
|
|
53 |
|
54 |
submit_button.click(process_and_output, inputs=input_text, outputs=[output_audio, output_text])
|
55 |
|
56 |
# Run the app
|
57 |
+
blocks.launch()
|