reach-vb HF staff commited on
Commit
e90510f
1 Parent(s): 21f9f87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -26,7 +26,7 @@ from typing import Any, Callable, Dict, Generator, List, Optional, Tuple, Type,
26
 
27
  HF_TOKEN = os.environ.get("HF_TOKEN")
28
 
29
- def clear_cache():
30
  scan = scan_cache_dir()
31
  to_delete = []
32
  for repo in scan.repos:
@@ -111,7 +111,7 @@ def process_model(model_id, q_method,oauth_token: gr.OAuthToken | None):
111
  return (f"Error: {e}", "error.png")
112
  finally:
113
  shutil.rmtree("mlx_model", ignore_errors=True)
114
- clear_cache()
115
  print("Folder cleaned up successfully!")
116
 
117
  css="""/* Custom CSS to allow scrolling */
 
26
 
27
  HF_TOKEN = os.environ.get("HF_TOKEN")
28
 
29
+ def clear_hf_cache_space():
30
  scan = scan_cache_dir()
31
  to_delete = []
32
  for repo in scan.repos:
 
111
  return (f"Error: {e}", "error.png")
112
  finally:
113
  shutil.rmtree("mlx_model", ignore_errors=True)
114
+ clear_hf_cache_space()
115
  print("Folder cleaned up successfully!")
116
 
117
  css="""/* Custom CSS to allow scrolling */