Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
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(
|