simonlee-cb commited on
Commit
753ec7b
·
1 Parent(s): e620492

fix: delete files after uploading

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -50,6 +50,10 @@ if submitted:
50
  try:
51
  resized_images = [resize_image(image) for image in user_images]
52
  uploaded_images = client.upload_images(resized_images)
 
 
 
 
53
  except Exception as e:
54
  st.error(f"Error uploading images: {e}")
55
 
 
50
  try:
51
  resized_images = [resize_image(image) for image in user_images]
52
  uploaded_images = client.upload_images(resized_images)
53
+ # delete resized image files
54
+ for image in resized_images:
55
+ image.close()
56
+ os.remove(image.name)
57
  except Exception as e:
58
  st.error(f"Error uploading images: {e}")
59