Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -105,7 +105,10 @@ def create_interface():
|
|
| 105 |
gr.Markdown("# Image Captioning Model")
|
| 106 |
gr.Markdown("Use one of the example images or upload your own")
|
| 107 |
|
| 108 |
-
#
|
|
|
|
|
|
|
|
|
|
| 109 |
example_images = get_example_images()
|
| 110 |
if example_images:
|
| 111 |
gr.Examples(
|
|
|
|
| 105 |
gr.Markdown("# Image Captioning Model")
|
| 106 |
gr.Markdown("Use one of the example images or upload your own")
|
| 107 |
|
| 108 |
+
# 1. Initialize the input component FIRST, but prevent it from showing up yet
|
| 109 |
+
image_input = gr.Image(type="pil", label="Upload Image", render=False)
|
| 110 |
+
|
| 111 |
+
# 2. Now setup Examples (Visual location: TOP). It works because image_input exists now.
|
| 112 |
example_images = get_example_images()
|
| 113 |
if example_images:
|
| 114 |
gr.Examples(
|