Spaces:
Running
Running
| import os | |
| #from mms import generate_audio_mms | |
| from tts import synthesize, TTS_LANGUAGES | |
| import torch | |
| import base64 | |
| with open("Iso_Logotipo_Ceibal.png", "rb") as image_file: | |
| encoded_image = base64.b64encode(image_file.read()).decode() | |
| import gradio as gr | |
| with gr.Blocks() as demo: | |
| gr.Markdown( | |
| """ | |
| <center> | |
| <h1> | |
| Uso de AI para la generación de audio a partir de texto. | |
| </h1> | |
| <img src='data:image/jpg;base64,{}' width=200px> | |
| <h3> | |
| Con este espacio podrás producir audio que lee el texto de entrada. Podrás ajustar la velocidad con a la que habla el modelo. | |
| </h3> | |
| </center> | |
| """.format(encoded_image)) | |
| with gr.Row(): | |
| with gr.Column(): | |
| leng = gr.Radio(choices=["spa","eng"], value="spa",label="Seleccioná un idioma entre Inglés (eng) y Español (spa)") | |
| textbox = gr.Textbox(label="Ingrese texto") | |
| slider = gr.Slider(minimum=0.1, maximum=4.0, value=1.0, step=0.1, label="Velocidad de voz") | |
| button = gr.Button("Hablar") | |
| with gr.Column(): | |
| audio_output = gr.Audio() | |
| button.click(synthesize,[textbox,slider,leng],audio_output) | |
| demo.launch() |