Skip to content

Commit

Permalink
Fix: change task list to include python tasks into group
Browse files Browse the repository at this point in the history
  • Loading branch information
celiolarcher committed Jul 5, 2024
1 parent 9103e51 commit c24baaa
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
25 changes: 13 additions & 12 deletions lm_eval/tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,7 @@ def _get_task_and_group(self, task_dir: str):
if f.endswith(".yaml"):
yaml_path = os.path.join(root, f)
config = utils.load_yaml_config(yaml_path, mode="simple")
if self._config_is_python_task(config):
# This is a python class config
tasks_and_groups[config["task"]] = {
"type": "python_task",
"yaml_path": yaml_path,
}
elif self._config_is_group(config):
if self._config_is_group(config):
# This is a group config
tasks_and_groups[config["group"]] = {
"type": "group",
Expand All @@ -351,12 +345,19 @@ def _get_task_and_group(self, task_dir: str):
# }

elif self._config_is_task(config):
# This is a task config
task = config["task"]
tasks_and_groups[task] = {
"type": "task",
"yaml_path": yaml_path,
}
if self._config_is_python_task(config):
# This is a python class config
tasks_and_groups[task] = {
"type": "python_task",
"yaml_path": yaml_path,
}
else:
# This is a task config
tasks_and_groups[task] = {
"type": "task",
"yaml_path": yaml_path,
}

if "group" in config:
groups = config["group"]
Expand Down
2 changes: 0 additions & 2 deletions lm_eval/tasks/portuguese_benchmark/assin2/assin2rte.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions lm_eval/tasks/portuguese_benchmark/assin2/assin2sts.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions lm_eval/tasks/portuguese_benchmark/assin2/default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
group:
- portuguese_benchmark
task:
- task: assin2rte
class: !function task.Assin2RTE
- task: assin2sts
class: !function task.Assin2STS
2 changes: 2 additions & 0 deletions lm_eval/tasks/portuguese_benchmark/faquad/default.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
group:
- portuguese_benchmark
task: faquad
class: !function task.FaQuAD

0 comments on commit c24baaa

Please sign in to comment.