Load yaml config files from subfolders
(cfg, filepath="./configs")
| 7 | |
| 8 | |
| 9 | def get_module_config(cfg, filepath="./configs"): |
| 10 | """ |
| 11 | Load yaml config files from subfolders |
| 12 | """ |
| 13 | |
| 14 | yamls = glob.glob(pjoin(filepath, '*', '*.yaml')) |
| 15 | yamls = [y.replace(filepath, '') for y in yamls] |
| 16 | for yaml in yamls: |
| 17 | nodes = yaml.replace('.yaml', '').replace('/', '.') |
| 18 | nodes = nodes[1:] if nodes[0] == '.' else nodes |
| 19 | OmegaConf.update(cfg, nodes, OmegaConf.load('./configs' + yaml)) |
| 20 | |
| 21 | return cfg |
| 22 | |
| 23 | |
| 24 | def get_obj_from_str(string, reload=False): |