Skip to content

Commit aea80e6

Browse files
committed
Better task list_with_num
1 parent 3c12a08 commit aea80e6

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Diff for: lmms_eval/__main__.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -244,14 +244,17 @@ def cli_evaluate_single(args: Union[argparse.Namespace, None] = None) -> None:
244244
"\n" + "=" * 70 + "\n" + "\n\tYou are trying to check all the numbers in each task." + "\n\tThis action will download the complete dataset." + "\n\tIf the results are not clear initially, call this again." + "\n\n" + "=" * 70
245245
)
246246
eval_logger.info(log_message)
247-
task_dict = get_task_dict([task for task in sorted(ALL_TASKS)], model_name="llava")
248-
for task_name in task_dict.keys():
249-
task_obj = task_dict[task_name]
250-
if type(task_obj) == tuple:
251-
group, task_obj = task_obj
252-
if task_obj is None:
253-
continue
254-
eval_logger.info(f"\nTask : {task_obj.config.task}\n - #num : {len(task_obj.test_docs()) if task_obj.has_test_docs() else len(task_obj.validation_docs())}")
247+
for task_name in sorted(ALL_TASKS):
248+
try:
249+
task_dict = get_task_dict([task_name], model_name="llava")
250+
task_obj = task_dict[task_name]
251+
if type(task_obj) == tuple:
252+
group, task_obj = task_obj
253+
if task_obj is None:
254+
continue
255+
eval_logger.info(f"\nTask : {task_obj.config.task}\n - #num : {len(task_obj.test_docs()) if task_obj.has_test_docs() else len(task_obj.validation_docs())}")
256+
except Exception as e:
257+
eval_logger.debug(f"\nTask : {task_name} fail to load \n Exception : \n {e}")
255258
sys.exit()
256259
else:
257260
tasks_list = args.tasks.split(",")

0 commit comments

Comments
 (0)