Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,18 +1,21 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
def
|
4 |
-
return
|
5 |
|
6 |
iface = gr.Interface(
|
7 |
-
fn=
|
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.
|
13 |
-
gr.inputs.
|
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()
|