Skip to content

xlm.utils.omegaconf_resolvers

dictconfig_filter_key(d, fn)

Only keep keys where fn(key) is True. Support nested DictConfig.

remove_keys_with_double_underscores(d)

Remove keys with double underscores. This can be used to remove keys that are only present for computational purposes and are not part of the final config.

dummy_resolvers(names=DEFAULT_DUMMY_RESOLVER_NAMES)

Temporarily install passthrough OmegaConf resolvers for names.

For each name, a dummy resolver is registered (replacing any existing resolver) that returns the unresolved interpolation string "${<name>:<attr>}". This lets OmegaConf.resolve() succeed early in the config lifecycle, before the real resolvers (which depend on the datamodule, tokenizer, etc.) are available.

On exit, the previously registered resolver is restored for each name; if no resolver was registered before, the dummy is removed.