Skip to content

How to use store with hydra compose API? #510

Answered by jgbos
brijow asked this question in Q&A
Discussion options

You must be logged in to vote

There is no config zen_store. You need to create a config:

# ... same code above this line

store(
    make_config(
        hydra_defaults=[
            "_self_",
            {"player": "base"},
        ],
        player=None,
    ),
    name="config"
)

# We need to add the configs from our local store to Hydra's global config store
store.add_to_hydra_store()


from hydra import initialize, compose

with initialize(config_path=None, version_base="1.3"):
    cfg = compose(config_name="config", overrides=["player=brinda"])
    print(cfg)

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@brijow
Comment options

Comment options

You must be logged in to vote
1 reply
@brijow
Comment options

Answer selected by brijow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants