Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from io import BytesIO
|
|
5 |
from huggingface_hub import hf_hub_download
|
6 |
from piper import PiperVoice
|
7 |
from transformers import pipeline
|
8 |
-
|
9 |
|
10 |
def synthesize_speech(text):
|
11 |
|
@@ -34,12 +34,11 @@ def synthesize_speech(text):
|
|
34 |
with gr.Blocks(theme=gr.themes.Base()) as blocks:
|
35 |
gr.Markdown("# Text to Speech Synthesizer")
|
36 |
gr.Markdown("Enter text to synthesize it into speech using PiperVoice.")
|
37 |
-
input_text = gr.Textbox(label="Input Text")
|
38 |
output_audio = gr.Audio(label="Synthesized Speech", type="numpy")
|
39 |
-
output_text = gr.Textbox(label="Output Text", visible=False) # This is the new text output component
|
40 |
submit_button = gr.Button("Synthesize")
|
41 |
|
42 |
-
submit_button.click(synthesize_speech, inputs=input_text, outputs=[output_audio
|
43 |
|
44 |
# Run the app
|
45 |
blocks.launch()
|
|
|
5 |
from huggingface_hub import hf_hub_download
|
6 |
from piper import PiperVoice
|
7 |
from transformers import pipeline
|
8 |
+
import hazm_correction
|
9 |
|
10 |
def synthesize_speech(text):
|
11 |
|
|
|
34 |
with gr.Blocks(theme=gr.themes.Base()) as blocks:
|
35 |
gr.Markdown("# Text to Speech Synthesizer")
|
36 |
gr.Markdown("Enter text to synthesize it into speech using PiperVoice.")
|
37 |
+
input_text = preprocess_text(gr.Textbox(label="Input Text"))
|
38 |
output_audio = gr.Audio(label="Synthesized Speech", type="numpy")
|
|
|
39 |
submit_button = gr.Button("Synthesize")
|
40 |
|
41 |
+
submit_button.click(synthesize_speech, inputs=input_text, outputs=[output_audio])
|
42 |
|
43 |
# Run the app
|
44 |
blocks.launch()
|