jadechoghari commited on
Commit
98d0bf8
1 Parent(s): 1add98c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -11
app.py CHANGED
@@ -121,17 +121,8 @@ with gr.Blocks(css=css) as demo:
121
  ["examples/3.png", 1, "A crowded city", 500]
122
  ]
123
 
124
- def on_example_click(*args, **kwargs) -> Tuple[str, str]:
125
- example_image = args[0]
126
-
127
- # Map the image file to the correct example index (1, 2, 3)
128
- example_map = {
129
- "examples/1.png": 1,
130
- "examples/2.png": 2,
131
- "examples/3.png": 3
132
- }
133
-
134
- example_index = example_map.get(example_image, 1) # Default to 1 if not found
135
  return load_cached_example_outputs(example_index)
136
 
137
  gr.Examples(
 
121
  ["examples/3.png", 1, "A crowded city", 500]
122
  ]
123
 
124
+ def update_examples(index):
125
+ example_index = int(index) # Convert index to integer for use
 
 
 
 
 
 
 
 
 
126
  return load_cached_example_outputs(example_index)
127
 
128
  gr.Examples(