Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,6 +17,7 @@ import timeout_decorator
|
|
| 17 |
import spaces
|
| 18 |
import tempfile
|
| 19 |
import shutil
|
|
|
|
| 20 |
|
| 21 |
from registry import get_model
|
| 22 |
from core.describe_scene import describe_scene
|
|
@@ -25,6 +26,12 @@ from core.input_handler import resolve_input, validate_video, validate_image
|
|
| 25 |
from utils.helpers import format_error, generate_session_id
|
| 26 |
from huggingface_hub import hf_hub_download
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
# Setup logging
|
| 30 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
|
|
|
| 17 |
import spaces
|
| 18 |
import tempfile
|
| 19 |
import shutil
|
| 20 |
+
import os
|
| 21 |
|
| 22 |
from registry import get_model
|
| 23 |
from core.describe_scene import describe_scene
|
|
|
|
| 26 |
from utils.helpers import format_error, generate_session_id
|
| 27 |
from huggingface_hub import hf_hub_download
|
| 28 |
|
| 29 |
+
try:
|
| 30 |
+
shutil.rmtree(os.path.expanduser("~/.cache/huggingface"), ignore_errors=True)
|
| 31 |
+
shutil.rmtree("/home/user/.cache/huggingface", ignore_errors=True)
|
| 32 |
+
print("💥 Nuked HF model cache from runtime.")
|
| 33 |
+
except Exception as e:
|
| 34 |
+
print("🚫 Failed to nuke cache:", e)
|
| 35 |
|
| 36 |
# Setup logging
|
| 37 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|