davidyang5 commited on
Commit
f943c23
·
verified ·
1 Parent(s): 96259a0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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
- # Example images using all images from img directory
 
 
 
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(