File size: 952 Bytes
131da64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from pathlib import Path
import os

UNIDISC_DIR = Path(os.getenv("UNIDISC_DIR", Path(__file__).parent))
LIB_DIR = UNIDISC_DIR / "third_party"
CELEBV_DATA_DIR = Path(os.getenv("CELEBV_DATA_DIR", "/home/mprabhud/aswerdlo/repos/lib/CelebV-Text/downloaded_celebvtext"))
SCRATCH_CELEBV_DATA_DIR = Path("/scratch/aswerdlo/sora/celebv_text/downloaded_celebvtext")
CONFIG_PATH = os.getenv("UNIDISC_CONFIG_PATH", "configs")
HF_TOKEN = os.getenv("HF_TOKEN", os.getenv("HF_HUB_DATASETS_TOKEN"))
HF_DATASETS_CACHE = os.getenv("HF_DATASETS_CACHE", None)
HF_CACHE_DIR = os.getenv("HF_HOME", None)

if HF_CACHE_DIR is not None:
    HF_CACHE_DIR = Path(HF_CACHE_DIR)
elif HF_DATASETS_CACHE is not None:
    HF_CACHE_DIR = Path(HF_DATASETS_CACHE).parent
else:
    HF_CACHE_DIR = Path("~/.cache/huggingface").expanduser()
try:
    if SCRATCH_CELEBV_DATA_DIR.exists():
        CELEBV_DATA_DIR = SCRATCH_CELEBV_DATA_DIR
except:
    print(f"Error setting CELEBV_DATA_DIR")