-
-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage Question: User defined configuration #763
Comments
I am able to do the |
Hi @jgbos. This is the right way to achieve what you are after. Users can add their own configs in the Keep in mind that currently the composition order will not be what you want with respect to the primary config file: config.yaml: defaults:
- hydra/launcher: foo
- framework/foo : bar
config_in_config_py: oompa the composition order will be:
This means the user will not be able to override your framework configs from their config.yaml. defaults.yaml defaults:
- hydra/launcher: foo
- framework/foo : bar
- config config.yaml config_in_config_py: oompa @hydra.main(config_path="conf", config_name="defaults")
def main(cfg : DictConfig):
...
if __name__ == "__main__":
main() |
Also, if you are not already - please us Hydra 1.0.0rc1 or master for this. |
Thanks for taking the time tor respond to this questions. I think I'm getting closer to understanding the concept but currently still getting errors, essentially it cannot find from hydra.core.config_search_path import ConfigSearchPath
from hydra.plugins.search_path_plugin import SearchPathPlugin
class FrameworkSearchPathPlugin(SearchPathPlugin):
def manipulate_search_path(self, search_path: ConfigSearchPath):
search_path.append(
"framework",
"pkg://framework.configs",
) |
It does matter, yes. |
OK! I see now what I wasn't seeing before (I hope). I was trying to just put the code in my framework, but I need to make a search path plugin for my framework for hydra to find it. Is this correct? I create a plugin directory with As test, I cloned hydra and in the |
The example plugin is working as has unit tests. |
it's probably not the reason, but use |
Ack. That was it! I had to do Thanks for your patience and help, much appreciated |
Awesome. Once you are exporting your configs via a searchpath plugin, you are in the same config namespace as other projects. example:
along with class FrameworkSearchPathPlugin(SearchPathPlugin):
def manipulate_search_path(self, search_path: ConfigSearchPath):
search_path.append(
"framework",
"pkg://framework.configs",
) |
One question, you say above the defaults are set with defaults:
- hydra/launcher: foo
- framework/foo : bar
- config but I had do to: defaults:
- hydra/launcher: basic
- foo : user_defined # foo is defined in `framework` but has a user defined foo in conf/foo/user.yaml'> It doesn't recognize |
I didn't see the previous comment when typing that out. |
|
I have an usage question. I'm designing a toolbox that will contain a configuration of approaches to train and evaluate ML models. This toolbox is an application that can be installed with it's own configuration files.
Is there a way for the user to:
configs/<groups>/user_impl.yaml
. For example, their own dataset and modelsconfig.yaml
file that can utilize the local configurations and the packaged configurationsI'm struggling to figure out a solution to this. Do I use the
search_path
plugin? Thecompose
interface? Structured configs? I may be missing something simple. I feel like it's right there but I can't see it!The text was updated successfully, but these errors were encountered: