Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import os
|
|
|
|
| 2 |
from pathlib import Path
|
| 3 |
|
| 4 |
from huggingface_hub import snapshot_download
|
|
@@ -10,6 +11,11 @@ from huggingface_hub import snapshot_download
|
|
| 10 |
# Files will be placed under ckpt/ so the existing config paths keep working.
|
| 11 |
# ---------------------------------------------------------------------------
|
| 12 |
BASE_DIR = Path(__file__).parent.resolve()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
CKPT_DIR = BASE_DIR / "ckpt"
|
| 14 |
CKPT_DIR.mkdir(parents=True, exist_ok=True)
|
| 15 |
|
|
|
|
| 1 |
import os
|
| 2 |
+
import sys
|
| 3 |
from pathlib import Path
|
| 4 |
|
| 5 |
from huggingface_hub import snapshot_download
|
|
|
|
| 11 |
# Files will be placed under ckpt/ so the existing config paths keep working.
|
| 12 |
# ---------------------------------------------------------------------------
|
| 13 |
BASE_DIR = Path(__file__).parent.resolve()
|
| 14 |
+
ROOT_DIR = BASE_DIR.parent.resolve()
|
| 15 |
+
|
| 16 |
+
# Ensure project root is on sys.path so intra-repo imports (e.g. `optimizers`) work.
|
| 17 |
+
if str(ROOT_DIR) not in sys.path:
|
| 18 |
+
sys.path.insert(0, str(ROOT_DIR))
|
| 19 |
CKPT_DIR = BASE_DIR / "ckpt"
|
| 20 |
CKPT_DIR.mkdir(parents=True, exist_ok=True)
|
| 21 |
|