fix AttributeError: 'str' object has no attribute '_id'.
Browse files
app.py
CHANGED
|
@@ -41,9 +41,10 @@ with gr.Blocks(theme=gr.themes.Base()) as blocks:
|
|
| 41 |
gr.Markdown("Enter text to synthesize it into speech using PiperVoice.")
|
| 42 |
input_text = gr.Textbox(label="Input Text")
|
| 43 |
output_audio = gr.Audio(label="Synthesized Speech", type="numpy")
|
|
|
|
| 44 |
submit_button = gr.Button("Synthesize")
|
| 45 |
|
| 46 |
-
submit_button.click(synthesize_speech, inputs=input_text, outputs=[output_audio,
|
| 47 |
|
| 48 |
# Run the app
|
| 49 |
blocks.launch()
|
|
|
|
| 41 |
gr.Markdown("Enter text to synthesize it into speech using PiperVoice.")
|
| 42 |
input_text = gr.Textbox(label="Input Text")
|
| 43 |
output_audio = gr.Audio(label="Synthesized Speech", type="numpy")
|
| 44 |
+
output_text = gr.Textbox(label="Output Text", visible=False) # This is the new text output component
|
| 45 |
submit_button = gr.Button("Synthesize")
|
| 46 |
|
| 47 |
+
submit_button.click(synthesize_speech, inputs=input_text, outputs=[output_audio, output_text])
|
| 48 |
|
| 49 |
# Run the app
|
| 50 |
blocks.launch()
|