SwinTExCo / src /models /vit /config.py
duongttr's picture
Upload folder using huggingface_hub
62ef5f4
raw
history blame
462 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"]