I want to define project root path in Hydra config file without hardcoding it. 'til now couldn't find any feature of Hydra that can imply the path!
E.g., suppose we have the following project structure:
project-name
├── conf
│ ├── config.yaml
│ ├── config.py
├── src
│ ├── model.py
Now I want to define the project path in config.yaml
up to project-name
. For example project_path: C:\\Projects\\project-name
. However, instead of hardcoding C:\\Projects\\
, I want Hydra to figure out for me what the preceding path is up to and including project-name
.
With python I can do something in config.py
like:
str(Path(__file__).parent.parent.absolute())
However, I want to get rid of config.py
, and do all the configurations in config.yaml
Any ideas?