File size: 982 Bytes
c0c3c19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 functions import audio2text, text2sentiment, classify_image

demo = gr.Blocks()

with demo:
  gr.Markdown("Este es el segundo demos con Blocks")
  with gr.Tabs():
    with gr.TabItem("Transcribe audio en espaΓ±ol"):
      with gr.Row():
        audio = gr.Audio(sources=["microphone"], type="filepath")
        transcription = gr.Textbox()
      b1 = gr.Button("Transcribe porfa")

    with gr.TabItem("Analisis de sentimiento en espaΓ±ol"):
      with gr.Row():
        texto = gr.Textbox()
        label = gr.Label()
      b2 = gr.Button("Sentimiento porfa")

    with gr.TabItem("Clasificacion de imagenes"):
      with gr.Row():
        image = gr.Image(type='pil')
        lb_image = gr.Label(num_top_classes=3)
      b3 = gr.Button("Clasifica tu imagen")

    b1.click(audio2text, inputs=audio, outputs=transcription)
    b2.click(text2sentiment, inputs=texto, outputs=label)
    b3.click(classify_image, inputs=image, outputs=lb_image)

demo.launch()