是否可以仅导入单个配置参数,而不是全部在Hydra中?
constants_config.yaml
site: fb
another_site: google
my_config.yaml
my_site: ${constants_config.yaml]
产生的my_config.yaml
my_site: fb
我只想获得一个常数,而不是整个constants_config.yaml(通过使用默认来完成)
constants_config.yaml
site: fb
another_site: google
my_config.yaml
my_site: ${constants_config.yaml]
Resulting my_config.yaml
my_site: fb
I just want to get a single constant, not the whole constants_config.yaml (which is done by using default)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不可能直接。
您可以将插值用于常数节点。
类似:
constants.yaml:
main.yaml:
组成的配置应看起来像:
Not possible directly.
You can do it with interpolation into a constants node.
Something like:
constants.yaml:
main.yaml:
The composed config should look something like: