Spaces:
Paused
Paused
Update app.py
Browse files70 unmodified lines7172737475767778798081826 unmodified lines8990919293949596979899105 unmodified lines20520620720820921070 unmodified linesfor file in img_files:os.remove(file)# Add "Save All" button with emojisave_all_button = gr.Button("💾 Save All", scale=1)# Add "Clear All" button with emojiclear_all_button = gr.Button("🗑️ Clear All", scale=1)# Function to handle "Save All" button clickdef save_all_button_click():images = [file for file in os.listdir() if file.lower().endswith((".png", ".jpg", ".jpeg"))]6 unmodified linesdef clear_all_button_click():clear_all_images()# Add buttons to the Streamlit appgr.button(save_all_button)gr.button(clear_all_button)105 unmodified lines"""with gr.Blocks(css=css) as demo:# Attach click event handlers to the buttonssave_all_button.click(save_all_button_click)clear_all_button.click(clear_all_button_click)70 unmodified lines7172737475766 unmodified lines838485868788105 unmodified lines19419519619719819920020120220320420520620720870 unmodified linesfor file in img_files:os.remove(file)# Function to handle "Save All" button clickdef save_all_button_click():images = [file for file in os.listdir() if file.lower().endswith((".png", ".jpg", ".jpeg"))]6 unmodified linesdef clear_all_button_click():clear_all_images()105 unmodified lines"""with gr.Blocks(css=css) as demo:# Add "Save All" button with emojisave_all_button = gr.Button("💾 Save All", scale=1)# Add "Clear All" button with emojiclear_all_button = gr.Button("🗑️ Clear All", scale=1)# Add buttons to the Streamlit appgr.Button(save_all_button)gr.Button(clear_all_button)# Attach click event handlers to the buttonssave_all_button.click(save_all_button_click)clear_all_button.click(clear_all_button_click)
app.py+9-11