jadechoghari commited on
Commit
0eb00d8
·
verified ·
1 Parent(s): ab6ed15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -122,17 +122,17 @@ with gr.Blocks(css=css) as demo:
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
  # Add the examples to Gradio
138
  gr.Examples(
 
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
  # Add the examples to Gradio
138
  gr.Examples(