Hendrik Schroeter commited on
Commit
2cbf753
1 Parent(s): b64ea7b

Try fix cleanup

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -252,11 +252,12 @@ def spec_im(
252
 
253
 
254
  def cleanup_tmp(filter: List[str] = [], hours_keep=2):
 
255
  # Cleanup some old wav files
256
  if os.path.exists("/tmp"):
257
  for f in glob.glob("/tmp/*"):
258
  is_old = (time.time() - os.path.getmtime(f)) / 3600 > hours_keep
259
- if is_old and f not in filter:
260
  try:
261
  os.remove(f)
262
  logger.info(f"Removed file {f}")
@@ -272,7 +273,7 @@ def toggle(choice):
272
 
273
 
274
  with gr.Blocks() as demo:
275
- with gr.Row():
276
  gr.Markdown(
277
  """
278
  ## DeepFilterNet2 Demo\
 
252
 
253
 
254
  def cleanup_tmp(filter: List[str] = [], hours_keep=2):
255
+ filter.append("p232")
256
  # Cleanup some old wav files
257
  if os.path.exists("/tmp"):
258
  for f in glob.glob("/tmp/*"):
259
  is_old = (time.time() - os.path.getmtime(f)) / 3600 > hours_keep
260
+ if is_old and (filt not in f for filt in filter):
261
  try:
262
  os.remove(f)
263
  logger.info(f"Removed file {f}")
 
273
 
274
 
275
  with gr.Blocks() as demo:
276
+ with gr.Row():/
277
  gr.Markdown(
278
  """
279
  ## DeepFilterNet2 Demo\