File size: 496 Bytes
f1368c4
485e053
 
 
 
 
f1368c4
 
 
 
 
 
 
 
485e053
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from pathlib import Path
import os

def is_on_spaces():
    return "SPACE_ID" in os.environ or "HF_SPACE_ID" in os.environ


DEEPENGINEER_CODE_DIR = Path(__file__).parent
DEEPENGINEER_SRC_DIR = DEEPENGINEER_CODE_DIR.parent
DEEPENGINEER_ROOT_DIR = DEEPENGINEER_SRC_DIR.parent

assert DEEPENGINEER_CODE_DIR.name == "deepengineer"
assert DEEPENGINEER_SRC_DIR.name == "src"

if is_on_spaces():
    DATA_DIR = Path("/data")
else:
    DATA_DIR = DEEPENGINEER_ROOT_DIR / "data"

assert DATA_DIR.exists()