File size: 559 Bytes
bf928ee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""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)