Spaces:
Sleeping
Sleeping
lichorosario
commited on
Commit
·
0ec398b
1
Parent(s):
42256e1
feat: Refactor clear_output function in app.py
Browse filesThe clear_output function in app.py has been refactored to simplify the code and improve readability. Instead of directly modifying the image_slider list, the function now returns a new list with None values for both elements. This change ensures consistency and reduces the chances of introducing bugs in the future.
app.py
CHANGED
@@ -271,9 +271,7 @@ with gr.Blocks(css=css) as demo:
|
|
271 |
|
272 |
with gr.Row():
|
273 |
def clear_output(image_slider):
|
274 |
-
|
275 |
-
image_slider[1] = None
|
276 |
-
return image_slider
|
277 |
|
278 |
with gr.Column():
|
279 |
generated_image = gr.Image(label="Input Image", type="filepath")
|
|
|
271 |
|
272 |
with gr.Row():
|
273 |
def clear_output(image_slider):
|
274 |
+
return [None, None]
|
|
|
|
|
275 |
|
276 |
with gr.Column():
|
277 |
generated_image = gr.Image(label="Input Image", type="filepath")
|