@@ -121,10 +121,14 @@ def load_config(
121121 # all the paths may be concatenated with ":"
122122 p = str (overwrite ).split (":" )
123123 for path in p :
124- overwrite_configs .append (_load_overwrite_conf (Path (path )))
124+ c = _load_overwrite_conf (Path (path ))
125+ c = _load_streams_in_config (c )
126+ overwrite_configs .append (c )
125127 else :
126128 # If it is a dict or DictConfig, we can directly use it
127- overwrite_configs .append (_load_overwrite_conf (overwrite ))
129+ c = _load_overwrite_conf (overwrite )
130+ c = _load_streams_in_config (c )
131+ overwrite_configs .append (c )
128132
129133 if from_run_id is None :
130134 base_config = _load_default_conf ()
@@ -135,6 +139,22 @@ def load_config(
135139 return OmegaConf .merge (base_config , private_config , * overwrite_configs )
136140
137141
142+ def _load_streams_in_config (config : Config ) -> Config :
143+ """If the config contains a streams_directory, loads the streams and returns the config with
144+ the streams set."""
145+ streams_directory = config .get ("streams_directory" , None )
146+ config = config .copy ()
147+ if streams_directory is not None :
148+ streams_directory = Path (streams_directory )
149+ if not streams_directory .is_dir ():
150+ msg = f"Streams directory { streams_directory } does not exist."
151+ raise FileNotFoundError (msg )
152+
153+ _logger .info (f"Loading streams from { streams_directory } " )
154+ config .streams = load_streams (streams_directory )
155+ return config
156+
157+
138158def set_run_id (config : Config , run_id : str | None , reuse_run_id : bool ) -> Config :
139159 """
140160 Determine and set run_id of current run.
0 commit comments