From 6b256cb5b1d76a0c78db9aaa2a3db0e0771fa0f6 Mon Sep 17 00:00:00 2001 From: Jose Javier <26491792+josejg@users.noreply.github.com> Date: Thu, 11 Jul 2024 18:19:11 -0700 Subject: [PATCH] Log all extraneous_keys in one go for ease of development (#1344) --- llmfoundry/utils/config_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llmfoundry/utils/config_utils.py b/llmfoundry/utils/config_utils.py index 36a4d75fb8..2667fceb67 100644 --- a/llmfoundry/utils/config_utils.py +++ b/llmfoundry/utils/config_utils.py @@ -347,9 +347,9 @@ def make_dataclass_and_log_config( if 'variables' not in unstructured_config: unstructured_config['variables'] = {} - for key in extraneous_keys: + if len(extraneous_keys) > 0: raise ValueError( - f'Unused parameter {key} found in cfg. Please check your yaml to ensure this parameter is necessary. Please place any variables under the `variables` key.', + f'Unused parameters {sorted(extraneous_keys)} found in cfg. Please check your yaml to ensure these parameters are necessary. Please place any variables under the `variables` key.', ) dataclass_dict_config: DictConfig = om.structured(