You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To add a new task, first either open an issue, to determine whether it will be
4
-
integrated in the core evaluations of lighteval, in the extended tasks, or the
5
-
community tasks, and add its dataset on the hub.
6
-
7
-
- Core evaluations are evaluations that only require standard logic in their
8
-
metrics and processing, and that we will add to our test suite to ensure non
9
-
regression through time. They already see high usage in the community.
10
-
- Extended evaluations are evaluations that require custom logic in their
11
-
metrics (complex normalisation, an LLM as a judge, ...), that we added to
12
-
facilitate the life of users. They already see high usage in the community.
13
-
- Community evaluations are submissions by the community of new tasks.
3
+
Lighteval provides a flexible framework for creating custom evaluation tasks. This guide explains how to create and integrate new tasks into the evaluation system.
4
+
5
+
## Task Categories
6
+
7
+
Before creating a custom task, consider which category it belongs to:
8
+
9
+
### Core Evaluations
10
+
Core evaluations are evaluations that only require standard logic in their
11
+
metrics and processing, and that we will add to our test suite to ensure non-regression through time. They already see high usage in the community.
12
+
13
+
### Extended Evaluations
14
+
Extended evaluations are evaluations that require custom logic in their
15
+
metrics (complex normalization, an LLM as a judge, etc.), that we added to
16
+
facilitate the life of users. They already see high usage in the community.
17
+
18
+
### Community Evaluations
19
+
Community evaluations are submissions by the community of new tasks.
14
20
15
21
A popular community evaluation can move to become an extended or core evaluation over time.
16
22
17
23
> [!TIP]
18
-
> You can find examples of custom tasks in the <ahref="https://github.com/huggingface/lighteval/tree/main/community_tasks">community_task</a> directory.
24
+
> You can find examples of custom tasks in the [community_tasks](https://github.com/huggingface/lighteval/tree/main/community_tasks) directory.
19
25
20
-
## Step by step creation of a custom task
26
+
## Step-by-Step Creation of a Custom Task
21
27
22
28
> [!WARNING]
23
-
> To contribute your custom metric to the lighteval repo, you would first need
29
+
> To contribute your custom task to the Lighteval repository, you would first need
24
30
> to install the required dev dependencies by running `pip install -e .[dev]`
25
31
> and then run `pre-commit install` to install the pre-commit hooks.
26
32
27
-
First, create a python file under the `community_tasks` directory.
33
+
### Step 1: Create the Task File
34
+
35
+
First, create a Python file under the `community_tasks` directory.
36
+
37
+
### Step 2: Define the Prompt Function
28
38
29
39
You need to define a prompt function that will convert a line from your
30
40
dataset to a document to be used for evaluation.
31
41
32
42
```python
43
+
from lighteval.tasks.requests import Doc
44
+
33
45
# Define as many as you need for your different tasks
34
-
defprompt_fn(line, task_name: str=None):
46
+
defprompt_fn(line: dict, task_name: str):
35
47
"""Defines how to go from a dataset line to a doc object.
36
48
Follow examples in src/lighteval/tasks/default_prompts.py, or get more info
0 commit comments