You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The need is to be able to load config_path="../config/env", config_name="question" without the outer part of the config. In another scripts and notebooks, the whole config would be read.
I am aware that this can be done with reading a parent config and overriding groups manually from the code, but can it be done in a clean and direct way?
If there wasn't data_sources: dict[str, DataSource] dict in env, this would be trivial. But inheritance in dictionary value requires me to both
register SoundData and ImageData at ConfigStore with their group specified: This is solvable by parametrizing the group.
use package override at the start of image and sound configurations + flattened configuration. This is the problem.
Is it possible to get rid of hardcoded package override and absolute group dependencies? Is it maybe possible to tweak with the defaults list in config/env/question.yaml, so config/env/data_sources/image1.yaml can be instantiated in this form:
image1:
name: instagram
size_x: 2560
size_y: 1440
Is there any other way to arrange configs above to be able to load both at the TrainConfig and EnvConfig level?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I want to make my code modular because some parts can be reused without the whole project overhead. Here is the example:
my_package/main.py:
config/config.yaml:
config/env/question.yaml:
config/env/data_sources/sound1.yaml:
config/env/data_sources/image1.yaml:
config/env/data_sources/image2.yaml:
The need is to be able to load
config_path="../config/env", config_name="question"
without the outer part of the config. In another scripts and notebooks, the whole config would be read.I am aware that this can be done with reading a parent config and overriding groups manually from the code, but can it be done in a clean and direct way?
If there wasn't
data_sources: dict[str, DataSource]
dict inenv
, this would be trivial. But inheritance in dictionary value requires me to bothSoundData
andImageData
atConfigStore
with their group specified: This is solvable by parametrizing the group.Is it possible to get rid of hardcoded package override and absolute group dependencies? Is it maybe possible to tweak with the defaults list in
config/env/question.yaml
, soconfig/env/data_sources/image1.yaml
can be instantiated in this form:Is there any other way to arrange configs above to be able to load both at the
TrainConfig
andEnvConfig
level?Beta Was this translation helpful? Give feedback.
All reactions