Skip to content

Commit

Permalink
Merge pull request Vision-CAIR#407 from junchen14/main
Browse files Browse the repository at this point in the history
update evaluation configs
  • Loading branch information
junchen14 authored Nov 1, 2023
2 parents 8702294 + c4f7cfa commit 353bcc7
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions minigpt4/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,21 +116,22 @@ def build_dataset_config(config):
@staticmethod
def build_evaluation_dataset_config(config):
datasets = config.get("evaluation_datasets", None)
if datasets is None:
raise KeyError(
"Expecting 'datasets' as the root key for dataset configuration."
)
# if datasets is None:
# raise KeyError(
# "Expecting 'datasets' as the root key for dataset configuration."
# )

dataset_config = OmegaConf.create()

for dataset_name in datasets:
builder_cls = registry.get_builder_class(dataset_name)
if datasets is not None:
for dataset_name in datasets:
builder_cls = registry.get_builder_class(dataset_name)

# hierarchy override, customized config > default config
dataset_config = OmegaConf.merge(
dataset_config,
{"evaluation_datasets": {dataset_name: config["evaluation_datasets"][dataset_name]}},
)
# hierarchy override, customized config > default config
dataset_config = OmegaConf.merge(
dataset_config,
{"evaluation_datasets": {dataset_name: config["evaluation_datasets"][dataset_name]}},
)

return dataset_config

Expand Down

0 comments on commit 353bcc7

Please sign in to comment.