File size: 1,166 Bytes
19adc70
12b517b
19adc70
6c061e6
f6092a4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63d0e80
4f3e912
f6092a4
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import gradio as gr
from transformers import pipeline
from funciones import transcribe, clasificacion, clasifica_imagen

demo = gr.Blocks()
with demo:
    gr.Markdown("Clasificacion de Audio a Sentimientos")
    with gr.Tabs():
        with gr.TabItem("Transcribe Audio en espanol"):
            with gr.Row():
                audio = gr.Audio(source="microphone",type="filepath")
                transcripcion = gr.Textbox()
            boton1 = gr.Button('Transcribe pofis :3')
            
        with gr.TabItem("Analisis de Sentimientos"):
            with gr.Row():
                text = gr.Textbox()
                label = gr.Label()
            boton2 = gr.Button('Clasifica el sentimiento ')
        
        with gr.TabItem("Clasificacion de Imagenes"):
            with gr.Row():
                 img = gr.Image(shape = (224,224))
                 tipo = gr.Label(num_top_classes = 3)
            boton3 = gr.Button('Clasifica la imagen ')

        boton1.click(transcribe,inputs = audio,outputs= transcripcion)
        boton2.click(clasificacion,inputs=text, outputs=label)
        boton3.click(clasifica_imagen,inputs=img,outputs=tipo)

demo.launch()