Skip to content

Commit 7a177d2

Browse files
update the build_model_from_config with empty dict
1 parent c6ea1c1 commit 7a177d2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

run.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
from vlmeval.utils.result_transfer import MMMU_result_transfer, MMTBench_result_transfer
1111

1212

13-
def build_model_from_config(cfg):
13+
def build_model_from_config(cfg, model_name):
1414
import vlmeval.api
1515
import vlmeval.vlm
16-
config = cp.deepcopy(cfg)
16+
config = cp.deepcopy(cfg[model_name])
17+
if config == {}:
18+
return supported_VLM[model_name]()
1719
assert 'class' in config
1820
cls_name = config.pop('class')
1921
if hasattr(vlmeval.api, cls_name):
@@ -179,7 +181,7 @@ def main():
179181
os.makedirs(pred_root, exist_ok=True)
180182

181183
if use_config:
182-
model = build_model_from_config(cfg['model'][model_name])
184+
model = build_model_from_config(cfg['model'], model_name)
183185

184186
for _, dataset_name in enumerate(args.data):
185187
try:

0 commit comments

Comments
 (0)