Skip to content

Serialize selected config groups at runtime #2431

Answered by Jasha10
addisonklinke asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, see hydra.runtime.choices.
You can access it using the hydra resolver (${hydra:runtime.choices}) or in your python code as below:

from omegaconf import DictConfig
import hydra
from hydra.core.hydra_config import HydraConfig

@hydra.main(version_base=None, config_path="conf", config_name="config")
def my_app(cfg: DictConfig) -> None:
    print(HydraConfig.get().runtime.choices)

if __name__ == "__main__":
    my_app()

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by addisonklinke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants