Spaces:
Sleeping
Sleeping
File size: 484 Bytes
3d85088 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import yaml
from pathlib import Path
import os
def load_config():
return yaml.load(
open(Path(__file__).parent / "config.yml", "r"), Loader=yaml.FullLoader
)
def check_os_environ(key, use):
if key not in os.environ:
raise ValueError(
f"{key} is not defined in the os variables, it is required for {use}."
)
def dataset_dir():
check_os_environ("DATASET", "data loading")
return os.environ["DATASET"]
|