milyiyo commited on
Commit
52b6a47
1 Parent(s): d0b1dd7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -1,18 +1,21 @@
1
  import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
  iface = gr.Interface(
7
- fn=greet,
8
  inputs=
9
  [
10
  # gr.inputs.Textbox(lines=1, placeholder='autor', default="", label=None),
11
  gr.inputs.Dropdown(['Pepe', 'Juan'], type="value", label='Nombre del autor'),
12
- gr.inputs.Textbox(lines=1, placeholder='sentimiento', label='Sentimiento del texto generado'),
13
- gr.inputs.Radio(['positivo', 'negativo'], type="value", label=None),
14
- gr.inputs.Textbox(lines=1, placeholder='palabras', label='Palabras que desea incluir'),
15
  gr.inputs.Textbox(lines=4, placeholder='texto inicial', label='Texto inicial'),
16
  ],
17
- outputs="text")
 
 
 
 
18
  iface.launch()
 
1
  import gradio as gr
2
 
3
+ def make_poem(author, sentiment, words, text):
4
+ return [author, sentiment, words, text]
5
 
6
  iface = gr.Interface(
7
+ fn=make_poem,
8
  inputs=
9
  [
10
  # gr.inputs.Textbox(lines=1, placeholder='autor', default="", label=None),
11
  gr.inputs.Dropdown(['Pepe', 'Juan'], type="value", label='Nombre del autor'),
12
+ gr.inputs.Radio(['positivo', 'negativo'], type="value", label='Sentimiento del texto generado'),
13
+ gr.inputs.Textbox(lines=1, placeholder='palabra_1, palabra_2, ..., palabra_n', label='Palabras que desea incluir'),
 
14
  gr.inputs.Textbox(lines=4, placeholder='texto inicial', label='Texto inicial'),
15
  ],
16
+ outputs="text",
17
+ examples=
18
+ [
19
+ ['Pablo Neruda', 'positivo', 'cielo, luna, mar', 'Todos fueron a verle pasar']
20
+ ])
21
  iface.launch()