Spaces:
Sleeping
Sleeping
Update app.py (#20)
Browse files- Update app.py (e90510fc4b85943cd8dfe8caf2b07b47b9ed5909)
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
|
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 |
-
|
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 */
|