Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tasks of type python_task are not listed in lm-eval --tasks list #2268

Open
giuliolovisotto opened this issue Aug 30, 2024 · 1 comment · May be fixed by #2288
Open

Tasks of type python_task are not listed in lm-eval --tasks list #2268

giuliolovisotto opened this issue Aug 30, 2024 · 1 comment · May be fixed by #2288

Comments

@giuliolovisotto
Copy link

giuliolovisotto commented Aug 30, 2024

Problem Description

When calling TaskManager._initialize_tasks I noticed that tasks which are managed by their own python class enter the _task_index with type="python_task":

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,
}

As a consequence, when printing the task list lm-eval --tasks list these are effectively omitted from any constructed table, which only consider types group, task or tag

self._all_groups = sorted(
[x for x in self._all_tasks if self._task_index[x]["type"] == "group"]
)
self._all_subtasks = sorted(
[x for x in self._all_tasks if self._task_index[x]["type"] == "task"]
)
self._all_tags = sorted(
[x for x in self._all_tasks if self._task_index[x]["type"] == "tag"]
)

How to reproduce

Simple way to notice this, take a task that is managed by a Python class, such as fda managed by task.FDA, I can run the following:

lm_eval --model hf  \
    --model_args pretrained=EleutherAI/pythia-160m,dtype="float" \
    --tasks fda \
    --device mps \
    --limit 10

Allthough, when I try to see fda in the list of tasks, e.g. lm-eval --tasks list | grep fda this doesn't appear in the table.

I would be happy to work on this but I'd like to hear a maintainer's opinion regarding whether these tasks should appear in tables and be treated the same way task-type tasks are treated, including their inclusion in the tag handling.

@haileyschoelkopf
Copy link
Collaborator

Hi! This check

 self._all_subtasks = sorted( 
     [x for x in self._all_tasks if self._task_index[x]["type"] == "task"] 
 ) 

should indeed be

 self._all_subtasks = sorted( 
     [x for x in self._all_tasks if self._task_index[x]["type"] in ["task", "python_task"]] 
 ) 

.

If you have the bandwidth to PR and test a fix, we'd be grateful, but will fix this ourselves if not!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants