Spaces:
Runtime error
Runtime error
Alberto Carmona
commited on
Commit
•
dfa018a
1
Parent(s):
f448d25
Follow a bug related to click
Browse files
app.py
CHANGED
@@ -64,6 +64,10 @@ def poem_to_image(poem):
|
|
64 |
return img
|
65 |
|
66 |
|
|
|
|
|
|
|
|
|
67 |
with gr.Blocks() as demo:
|
68 |
gr.Markdown(
|
69 |
"""This space is taking as a base the [Spanish Poem Generation](https://huggingface.co/spaces/hackathon-pln-es/poem-generation-es) created during the First Spanish Hackathon of NLP.
|
@@ -84,14 +88,14 @@ with gr.Blocks() as demo:
|
|
84 |
lines=1, placeholder='palabra_1, palabra_2, ..., palabra_n', label='Palabras que desea incluir'),
|
85 |
input_initial_text = gr.Textbox(
|
86 |
lines=4, placeholder='texto inicial', label='Texto inicial')
|
|
|
87 |
b1 = gr.Button("Generate Poem & Illustration")
|
|
|
|
|
|
|
88 |
output_poem_txt = gr.Textbox(lines=7)
|
89 |
output_image = gr.Image(type="filepath", shape=(256, 256))
|
90 |
|
91 |
-
b1.click(lambda x: x,
|
92 |
-
input_author,
|
93 |
-
output_poem_txt)
|
94 |
-
|
95 |
# b1.click(poem_generate,
|
96 |
# inputs=[input_author, input_sentiment,
|
97 |
# input_include_words, input_initial_text],
|
|
|
64 |
return img
|
65 |
|
66 |
|
67 |
+
def debug_fn(x):
|
68 |
+
return x
|
69 |
+
|
70 |
+
|
71 |
with gr.Blocks() as demo:
|
72 |
gr.Markdown(
|
73 |
"""This space is taking as a base the [Spanish Poem Generation](https://huggingface.co/spaces/hackathon-pln-es/poem-generation-es) created during the First Spanish Hackathon of NLP.
|
|
|
88 |
lines=1, placeholder='palabra_1, palabra_2, ..., palabra_n', label='Palabras que desea incluir'),
|
89 |
input_initial_text = gr.Textbox(
|
90 |
lines=4, placeholder='texto inicial', label='Texto inicial')
|
91 |
+
output_txt = gr.Textbox()
|
92 |
b1 = gr.Button("Generate Poem & Illustration")
|
93 |
+
b1.click(debug_fn,
|
94 |
+
input_author,
|
95 |
+
output_txt)
|
96 |
output_poem_txt = gr.Textbox(lines=7)
|
97 |
output_image = gr.Image(type="filepath", shape=(256, 256))
|
98 |
|
|
|
|
|
|
|
|
|
99 |
# b1.click(poem_generate,
|
100 |
# inputs=[input_author, input_sentiment,
|
101 |
# input_include_words, input_initial_text],
|