From 56cf630a31e6aa9ecb0885679655d055471cf121 Mon Sep 17 00:00:00 2001 From: "jinli.yl" Date: Fri, 18 Jul 2025 16:15:39 +0800 Subject: [PATCH] buyfix --- experiencemaker/config/config_parser.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/experiencemaker/config/config_parser.py b/experiencemaker/config/config_parser.py index 5a0418a3..6b5ef407 100644 --- a/experiencemaker/config/config_parser.py +++ b/experiencemaker/config/config_parser.py @@ -15,12 +15,14 @@ class ConfigParser: # step2: load from config yaml file cli_config: DictConfig = OmegaConf.from_dotlist(args) - config_path = cli_config.get("config_path") - if config_path: - config_path = Path(config_path) + temp_config: AppConfig = OmegaConf.to_object(OmegaConf.merge(self.app_config, cli_config)) + if temp_config.config_path: + config_path = Path(temp_config.config_path) else: - pre_defined_config = cli_config.get("pre_defined_config") - config_path = Path(__file__).parent / (pre_defined_config + ".yaml") + pre_defined_config = temp_config.pre_defined_config + if not pre_defined_config.endswith(".yaml"): + pre_defined_config += ".yaml" + config_path = Path(__file__).parent / pre_defined_config logger.info(f"load config from path={config_path}") yaml_config = OmegaConf.load(config_path) self.app_config = OmegaConf.merge(self.app_config, yaml_config)