File size: 998 Bytes
38ac59c
a80deed
38ac59c
50c43fa
 
 
 
 
 
 
 
 
420e951
50c43fa
 
 
 
 
420e951
50c43fa
 
 
1dfa758
 
420e951
50c43fa
 
 
c65fc54
1dfa758
50c43fa
32e98f7
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
32
33
import gradio as gr
from functions import audio_a_text, texto_a_sentimiento, classify_imagen

demo = gr.Blocks()

with demo:
  gr.Markdown("Este es el segundo demo con Blocks")
  with gr.Tabs():
    with gr.TabItem("Transcribe audio en español"):
      with gr.Row():
        audio = gr.Audio(source="microphone", type="filepath")
        transcripcion = gr.Textbox()
      b1 = gr.Button("Transcribir")

    with gr.TabItem("Análisis de sentimiento en español"):
      with gr.Row():
        texto = gr.Textbox()
        label = gr.Label()
      b2 = gr.Button("Clasificar sentimiento")

    with gr.TabItem("Clasificación de imagen"):
      with gr.Row():
        image = gr.Image(shape=(224,224))
        label2 = gr.Label(num_top_classes=3)
      b3 = gr.Button("Clasificar imagen")

    b1.click(audio_a_text, inputs = audio, outputs=transcripcion)
    b2.click(texto_a_sentimiento, inputs=texto, outputs=label)
    b3.click(classify_imagen, inputs=image, outputs=label2)
 

demo.launch()