Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,16 @@ import os
|
|
| 7 |
from inference import load_model, run # 注意是你新改过的 inference.py
|
| 8 |
import shutil
|
| 9 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
|
|
|
|
|
|
|
|
|
| 11 |
# 删除 Hugging Face 默认缓存目录(~/.cache)
|
| 12 |
cache_path = os.path.expanduser("~/.cache")
|
| 13 |
if os.path.exists(cache_path):
|
|
|
|
| 7 |
from inference import load_model, run # 注意是你新改过的 inference.py
|
| 8 |
import shutil
|
| 9 |
import os
|
| 10 |
+
import os
|
| 11 |
+
import subprocess
|
| 12 |
+
|
| 13 |
+
# 示例:查看当前目录大小
|
| 14 |
+
print("===== Space 中的目录结构和占用 =====")
|
| 15 |
+
subprocess.run("du -sh *", shell=True)
|
| 16 |
|
| 17 |
+
# 示例:列出缓存目录
|
| 18 |
+
print("===== .cache 目录 =====")
|
| 19 |
+
subprocess.run("ls -lh ~/.cache", shell=True)
|
| 20 |
# 删除 Hugging Face 默认缓存目录(~/.cache)
|
| 21 |
cache_path = os.path.expanduser("~/.cache")
|
| 22 |
if os.path.exists(cache_path):
|