Update app.py
Browse files
app.py
CHANGED
@@ -7,16 +7,16 @@ def show_image():
|
|
7 |
return image
|
8 |
|
9 |
# Gradio interface
|
10 |
-
|
11 |
-
|
12 |
-
inputs=gr.Button("The Peddler's Magic Seeds", elem_id="title_button"),
|
13 |
-
outputs="image",
|
14 |
-
title="",
|
15 |
-
description="Click the title to reveal the image related to the story."
|
16 |
-
)
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
7 |
return image
|
8 |
|
9 |
# Gradio interface
|
10 |
+
title_button = gr.Button("The Peddler's Magic Seeds")
|
11 |
+
image_output = gr.Image()
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
+
def display_image():
|
14 |
+
return show_image()
|
15 |
+
|
16 |
+
with gr.Blocks() as demo:
|
17 |
+
gr.Markdown("<h1 style='text-decoration: underline; cursor: pointer;'>The Peddler's Magic Seeds</h1>")
|
18 |
+
title_button.render()
|
19 |
+
title_button.click(display_image, inputs=None, outputs=image_output)
|
20 |
+
image_output.render()
|
21 |
+
|
22 |
+
demo.launch()
|