def recursive_config(config_path):
    """allows for stacking of configs in any depth."""
    config = OmegaConf.load(config_path)
    if config.includes is not None:
        includes = config.includes
        config.pop("includes")
        base_config = recursive_config(includes)
        config = OmegaConf.merge(base_config, config)
    return config
allows for stacking of configs in any depth.
structured_prompting/fairseq-version/fairseq/examples/MMPT/mmpt/utils/load_config.py