Spaces:
Runtime error
Runtime error
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() |