make_table_tasks.py 650 Bytes
Newer Older
Leo Gao's avatar
Leo Gao committed
1
2
3
4
from lm_eval import tasks
from pytablewriter import MarkdownTableWriter

writer = MarkdownTableWriter()
Leo Gao's avatar
Leo Gao committed
5
writer.headers = ["Task Name", "Train", "Val", "Test","Val/Test Docs", "Metrics"]
Leo Gao's avatar
Leo Gao committed
6
7
8
9
10
11
12
13
14
15
16
17

values = []

def chk(tf):
    if tf:
        return '✓'
    else:
        return ' '

for tname, Task in tasks.TASK_REGISTRY.items():
    task = Task()

Leo Gao's avatar
Leo Gao committed
18
19
20
    v = [tname,chk(task.has_training_docs()),chk(task.has_validation_docs()),chk(task.has_test_docs()), len(list(task.test_docs() if task.has_test_docs() else task.validation_docs())),', '.join(task.aggregation().keys())]
    print(v)
    values.append(v)
Leo Gao's avatar
Leo Gao committed
21
22
23
24

writer.value_matrix = values

print(writer.dumps())