EK100MIR / lavila /utils /config.py
gina9726's picture
Upload 29 files
b3660df verified
raw
history blame contribute delete
447 Bytes
import yaml
def load_base_cfg():
with open('configs/base.yml', 'r') as fp:
cfg = yaml.load(fp, Loader=yaml.SafeLoader)
return cfg
def load_cfg(cfg_file):
cfg = load_base_cfg()
with open(cfg_file, 'r') as fp:
exp_cfg = yaml.load(fp, Loader=yaml.SafeLoader)
cfg['model'].update(exp_cfg.get('model', {}))
cfg['data'].update(exp_cfg.get('data', {}))
dataset = cfg['data'].get('dataset')
return cfg