MCPcopy Create free account
hub / github.com/OpenSparseLLMs/MoM / initialize_tasks

Method initialize_tasks

lm-eval-harness/lm_eval/tasks/__init__.py:37–57  ·  view source on GitHub ↗

Creates an dictionary of tasks index. :param include_path: str = None An additional path to be searched for tasks :return Dictionary of task names as key and task metadata

(self, include_path: str = None)

Source from the content-addressed store, hash-verified

35 self.task_group_map = collections.defaultdict(list)
36
37 def initialize_tasks(self, include_path: str = None):
38 """Creates an dictionary of tasks index.
39
40 :param include_path: str = None
41 An additional path to be searched for tasks
42
43 :return
44 Dictionary of task names as key and task metadata
45 """
46 all_paths = [os.path.dirname(os.path.abspath(__file__)) + "/"]
47 if include_path is not None:
48 if isinstance(include_path, str):
49 include_path = [include_path]
50 all_paths.extend(include_path)
51
52 task_index = {}
53 for task_dir in all_paths:
54 tasks = self._get_task_and_group(task_dir)
55 task_index = {**tasks, **task_index}
56
57 return task_index
58
59 @property
60 def all_tasks(self):

Callers 1

__init__Method · 0.95

Calls 1

_get_task_and_groupMethod · 0.95

Tested by

no test coverage detected