Skip to content

How to get the path of the config that was given? #2750

Answered by odelalleau
msis asked this question in Q&A
Discussion options

You must be logged in to vote

Not sure if there's a better way but I think you can do (not fully tested):

from hydra.core.hydra_config import HydraConfig

cfg = HydraConfig.get()
config_name = cfg.job.config_name
config_path = [path["path"] for path in cfg.runtime.config_sources if path["schema"] == "file"][0]

Replies: 2 comments 1 reply

Comment options

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

Answer selected by msis
Comment options

You must be logged in to vote
0 replies
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