Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -128,6 +128,7 @@ Sintetizador de voz con la voz del locutor argentino Pedro Labattaglia.
|
|
128 |
with gr.Blocks(theme=theme) as demo:
|
129 |
gr.Markdown(description)
|
130 |
|
|
|
131 |
with gr.Row():
|
132 |
with gr.Column(equal_height=True): # Esto centra la imagen en la fila
|
133 |
gr.Image(
|
@@ -138,17 +139,7 @@ with gr.Blocks(theme=theme) as demo:
|
|
138 |
elem_id="image-container" # Asigna un ID CSS para agregar estilos personalizados
|
139 |
)
|
140 |
|
141 |
-
#
|
142 |
-
demo.css = """
|
143 |
-
#image-container img {
|
144 |
-
display: block;
|
145 |
-
margin-left: auto;
|
146 |
-
margin-right: auto;
|
147 |
-
max-width: 256px; /* Ancho máximo de 256px */
|
148 |
-
height: auto; /* Mantener la relación de aspecto */
|
149 |
-
}
|
150 |
-
"""
|
151 |
-
|
152 |
with gr.Row():
|
153 |
with gr.Column(scale=2):
|
154 |
language_selector = gr.Dropdown(label="Idioma", choices=supported_languages)
|
@@ -160,11 +151,23 @@ demo.css = """
|
|
160 |
generated_audio = gr.Audio(label="Audio generado", interactive=False)
|
161 |
metrics_output = gr.Textbox(label="Métricas", value="Tiempo de generación: -- segundos\nFactor de tiempo real: --")
|
162 |
|
|
|
163 |
generate_button.click(
|
164 |
predict,
|
165 |
inputs=[input_text, language_selector, reference_audio],
|
166 |
outputs=[generated_audio, metrics_output]
|
167 |
)
|
168 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
if __name__ == "__main__":
|
170 |
demo.launch()
|
|
|
128 |
with gr.Blocks(theme=theme) as demo:
|
129 |
gr.Markdown(description)
|
130 |
|
131 |
+
# Fila para centrar la imagen
|
132 |
with gr.Row():
|
133 |
with gr.Column(equal_height=True): # Esto centra la imagen en la fila
|
134 |
gr.Image(
|
|
|
139 |
elem_id="image-container" # Asigna un ID CSS para agregar estilos personalizados
|
140 |
)
|
141 |
|
142 |
+
# Fila para seleccionar idioma, referencia y generar voz
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
with gr.Row():
|
144 |
with gr.Column(scale=2):
|
145 |
language_selector = gr.Dropdown(label="Idioma", choices=supported_languages)
|
|
|
151 |
generated_audio = gr.Audio(label="Audio generado", interactive=False)
|
152 |
metrics_output = gr.Textbox(label="Métricas", value="Tiempo de generación: -- segundos\nFactor de tiempo real: --")
|
153 |
|
154 |
+
# Configuración del botón para generar voz
|
155 |
generate_button.click(
|
156 |
predict,
|
157 |
inputs=[input_text, language_selector, reference_audio],
|
158 |
outputs=[generated_audio, metrics_output]
|
159 |
)
|
160 |
|
161 |
+
# Estilos CSS personalizados
|
162 |
+
demo.css = """
|
163 |
+
#image-container img {
|
164 |
+
display: block;
|
165 |
+
margin-left: auto;
|
166 |
+
margin-right: auto;
|
167 |
+
max-width: 256px; /* Ancho máximo de 256px */
|
168 |
+
height: auto; /* Mantener la relación de aspecto */
|
169 |
+
}
|
170 |
+
"""
|
171 |
+
|
172 |
if __name__ == "__main__":
|
173 |
demo.launch()
|