Leonel Valencia commited on
Commit
c0c3c19
Β·
verified Β·
1 Parent(s): cdf962c

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -0
app.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from functions import audio2text, text2sentiment, classify_image
3
+
4
+ demo = gr.Blocks()
5
+
6
+ with demo:
7
+ gr.Markdown("Este es el segundo demos con Blocks")
8
+ with gr.Tabs():
9
+ with gr.TabItem("Transcribe audio en espaΓ±ol"):
10
+ with gr.Row():
11
+ audio = gr.Audio(sources=["microphone"], type="filepath")
12
+ transcription = gr.Textbox()
13
+ b1 = gr.Button("Transcribe porfa")
14
+
15
+ with gr.TabItem("Analisis de sentimiento en espaΓ±ol"):
16
+ with gr.Row():
17
+ texto = gr.Textbox()
18
+ label = gr.Label()
19
+ b2 = gr.Button("Sentimiento porfa")
20
+
21
+ with gr.TabItem("Clasificacion de imagenes"):
22
+ with gr.Row():
23
+ image = gr.Image(type='pil')
24
+ lb_image = gr.Label(num_top_classes=3)
25
+ b3 = gr.Button("Clasifica tu imagen")
26
+
27
+ b1.click(audio2text, inputs=audio, outputs=transcription)
28
+ b2.click(text2sentiment, inputs=texto, outputs=label)
29
+ b3.click(classify_image, inputs=image, outputs=lb_image)
30
+
31
+ demo.launch()