Skip to content

Conversation

albertvillanova
Copy link
Member

Fix wrong instructions and code for custom tasks.

We are giving instructions to convert custom tasks to dict but this is not necessary or done (only prints are proposed):

# Convert to dict for lighteval
if __name__ == "__main__":
    print(t.name for t in TASKS_TABLE)
    print(len(TASKS_TABLE))

In other parts of the code, we try to access attributes of Task instances as if it were a dict, which is wrong:

print(t["name"] for t in TASKS_TABLE)
  • should be t.name instead

This PR removes:

  • the instructions to convert to dict
  • the prints

@HuggingFaceDocBuilderDev
Copy link
Collaborator

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@clefourrier
Copy link
Member

Good catch! Feel free to merge once tests are OK!

@clefourrier clefourrier merged commit 500632a into huggingface:main Dec 16, 2024
3 checks passed
@albertvillanova albertvillanova deleted the fix-task-dict branch December 16, 2024 14:18
hynky1999 pushed a commit that referenced this pull request May 22, 2025
* Delete wrong instruction in custom task docs

* Delete wrong code for custom tasks

* Delete wrong code for extended tasks

* Delete wrong code for community tasks

* Delete unnecessary code for community tasks
NathanHB pushed a commit that referenced this pull request Sep 19, 2025
* Delete wrong instruction in custom task docs

* Delete wrong code for custom tasks

* Delete wrong code for extended tasks

* Delete wrong code for community tasks

* Delete unnecessary code for community tasks
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 this pull request may close these issues.

3 participants