Actividad 1 haciendose
Browse files- actividad1.py +42 -0
actividad1.py
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def audio_to_text(audio):
|
| 4 |
+
return "Funcionalidad de transcripción no implementada."
|
| 5 |
+
|
| 6 |
+
descripcion = """
|
| 7 |
+
<div style="display: flex; align-items: center; justify-content: center; flex-direction: row; gap: 20px;">
|
| 8 |
+
<div>
|
| 9 |
+
<h1 style="text-align: center;">PIAFP Lara</h1>
|
| 10 |
+
<p style="text-align: justify;">
|
| 11 |
+
El proyecto <a href="https://piafp-lara.com" target="_blank">PIAFP Lara</a> se traduce en un modelo de IA para facilitar la autonomía comunicativa de las personas con trastornos en el habla.<br>
|
| 12 |
+
Este modelo se ha reentrenado sobre el modelo Whisper de OpenAI, y a partir de un audio, genera un texto.
|
| 13 |
+
</p>
|
| 14 |
+
</div>
|
| 15 |
+
<div>
|
| 16 |
+
<img src="https://piafplara.es/wp-content/uploads/2022/12/logoLaraFinalGrande.png" alt="Logo Lara" style="max-width: 150px; height: auto;">
|
| 17 |
+
</div>
|
| 18 |
+
</div>
|
| 19 |
+
"""
|
| 20 |
+
|
| 21 |
+
footer = """
|
| 22 |
+
<p style="text-align: center; margin-top: 20px;">
|
| 23 |
+
El proyecto Lara es un proyecto educativo cuyo objetivo es dotar de autonomía comunicativa a las personas que padecen un trastorno en el habla.
|
| 24 |
+
</p>
|
| 25 |
+
"""
|
| 26 |
+
|
| 27 |
+
with gr.Blocks() as demo:
|
| 28 |
+
gr.HTML(descripcion)
|
| 29 |
+
with gr.Row():
|
| 30 |
+
audio_input = gr.Audio(label="Coloque el audio aquí", type="filepath")
|
| 31 |
+
text_output = gr.Textbox(label="output")
|
| 32 |
+
with gr.Row():
|
| 33 |
+
model_dropdown = gr.Dropdown(choices=["Modelo 1", "Modelo 2"], label="Modelos de Lara entrenados")
|
| 34 |
+
with gr.Row():
|
| 35 |
+
clear_button = gr.Button("Clear")
|
| 36 |
+
submit_button = gr.Button("Submit")
|
| 37 |
+
gr.HTML(footer)
|
| 38 |
+
|
| 39 |
+
submit_button.click(audio_to_text, inputs=audio_input, outputs=text_output)
|
| 40 |
+
|
| 41 |
+
if __name__ == "__main__":
|
| 42 |
+
demo.launch()
|