SwinTExCo / src /models /vit /config.py
duongttr's picture
Update new app
3d85088
raw
history blame
484 Bytes
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"]