| """Shared absolute paths for scripts executed directly from this directory.""" | |
| import os | |
| import sys | |
| from pathlib import Path | |
| PROJECT_ROOT = Path(__file__).resolve().parents[1] | |
| if str(PROJECT_ROOT) not in sys.path: | |
| sys.path.insert(0, str(PROJECT_ROOT)) | |
| CONF_DIR = PROJECT_ROOT / "conf" | |
| DATA_DIR = CONF_DIR / "data" | |
| VOCAB_DIR = CONF_DIR / "vocab" | |
| WEIGHT_DIR = PROJECT_ROOT / "weight" | |
| OUTPUT_DIR = PROJECT_ROOT / "output" | |
| def use_project_root(): | |
| """Run an upstream script's relative paths against the repository root.""" | |
| os.chdir(PROJECT_ROOT) | |