Skip to content
This repository was archived by the owner on Jan 11, 2025. It is now read-only.

Commit 500632a

Browse files
Fix wrong instructions and code for custom tasks (huggingface#450)
* 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
1 parent 93a056f commit 500632a

File tree

12 files changed

+0
-73
lines changed

12 files changed

+0
-73
lines changed

community_tasks/_template.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,3 @@ def __init__(
116116
sample_level_fn=lambda x: x, # how to compute score for one sample
117117
corpus_level_fn=np.mean, # aggregation
118118
)
119-
120-
# MODULE LOGIC
121-
# You should not need to touch this
122-
# Convert to dict for lighteval
123-
if __name__ == "__main__":
124-
print(t.name for t in TASKS_TABLE)
125-
print(len(TASKS_TABLE))

community_tasks/aimo_evals.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,3 @@ def aimo_prompt(line, task_name: str = None):
5656

5757
# STORE YOUR EVALS
5858
TASKS_TABLE = [task]
59-
60-
61-
# MODULE LOGIC
62-
# You should not need to touch this
63-
64-
if __name__ == "__main__":
65-
print(t.name for t in TASKS_TABLE)
66-
print(len(TASKS_TABLE))

community_tasks/arabic_evals.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,3 @@ def __init__(
856856
+ [toxigen_ar_task]
857857
+ [sciq_ar_task]
858858
)
859-
860-
if __name__ == "__main__":
861-
print(t.name for t in TASKS_TABLE)
862-
print(len(TASKS_TABLE))

community_tasks/german_rag_evals.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,3 @@ def prompt_fn_context_question_match(line, task_name: str = None):
221221

222222
# STORE YOUR EVALS
223223
TASKS_TABLE = [task1, task2, task3, task4]
224-
225-
226-
# MODULE LOGIC
227-
# You should not need to touch this
228-
229-
if __name__ == "__main__":
230-
print(t.name for t in TASKS_TABLE)
231-
print(len(TASKS_TABLE))

community_tasks/oz_evals.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,3 @@ def prompt_fn_oz_eval_task(line, task_name: str = None):
8787

8888
# STORE YOUR EVALS
8989
TASKS_TABLE = [oz_eval_task]
90-
91-
92-
if __name__ == "__main__":
93-
print(t["name"] for t in TASKS_TABLE)
94-
print(len(TASKS_TABLE))

community_tasks/serbian_eval.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,3 @@ def create_task_config(
784784
mmlu_world_religions,
785785
mmlu_all,
786786
]
787-
788-
if __name__ == "__main__":
789-
print(t.name for t in TASKS_TABLE)
790-
print(len(TASKS_TABLE))

docs/source/adding-a-custom-task.mdx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -167,17 +167,6 @@ TASKS_TABLE = SUBSET_TASKS
167167
# TASKS_TABLE = [task]
168168
```
169169

170-
Finally, you need to add a module logic to convert your task to a dict for lighteval.
171-
172-
```python
173-
# MODULE LOGIC
174-
# You should not need to touch this
175-
# Convert to dict for lighteval
176-
if __name__ == "__main__":
177-
print(t.name for t in TASKS_TABLE)
178-
print(len(TASKS_TABLE))
179-
```
180-
181170
Once your file is created you can then run the evaluation with the following command:
182171

183172
```bash

examples/nanotron/custom_evaluation_tasks.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,3 @@ def __init__(
671671
"all": ",".join(t[1] for t in _TASKS_STRINGS),
672672
"early-signal": EARLY_SIGNAL_TASKS,
673673
}
674-
675-
if __name__ == "__main__":
676-
print(t["name"] for t in TASKS_TABLE)
677-
print(len(TASKS_TABLE))

src/lighteval/tasks/extended/ifeval/main.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,3 @@ def agg_inst_level_acc(items):
160160
TASKS_TABLE = [ifeval]
161161

162162
extend_enum(Metrics, "ifeval_metric", ifeval_metrics)
163-
164-
if __name__ == "__main__":
165-
# Adds the metric to the metric list!
166-
print(t["name"] for t in TASKS_TABLE)
167-
print(len(TASKS_TABLE))

src/lighteval/tasks/extended/mix_eval/main.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,3 @@ def mean_dv_5(x):
228228

229229

230230
TASKS_TABLE = [mixeval_multichoice_easy, mixeval_freeform_easy, mixeval_multichoice_hard, mixeval_freeform_hard]
231-
232-
if __name__ == "__main__":
233-
# Adds the metric to the metric list!
234-
print(t["name"] for t in TASKS_TABLE)
235-
print(len(TASKS_TABLE))

0 commit comments

Comments
 (0)