hieunguyen1053 commited on
Commit
b0314f9
·
1 Parent(s): 00a16d9

Create tasks.py

Browse files
Files changed (1) hide show
  1. src/tasks.py +70 -0
src/tasks.py ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from dataclasses import dataclass
2
+
3
+ @dataclass
4
+ class Task:
5
+ code: str
6
+ name: str
7
+ metric: str
8
+ higher_is_better: bool = True
9
+ num_fewshot: int = 0
10
+
11
+
12
+ class Lambada(Task):
13
+ code = "lambada_vi"
14
+ name = "LAMBADA"
15
+ metric = "ppl"
16
+ higher_is_better = False
17
+ num_fewshot = 0
18
+
19
+
20
+ class Arc(Task):
21
+ code = "arc_vi"
22
+ name = "ARC"
23
+ metric = "acc_norm"
24
+ higher_is_better = True
25
+ num_fewshot = 25
26
+
27
+
28
+ class HellaSwag(Task):
29
+ code = "hellaswag_vi"
30
+ name = "HellaSwag"
31
+ metric = "acc_norm"
32
+ higher_is_better = True
33
+ num_fewshot = 10
34
+
35
+
36
+ class MMLU(Task):
37
+ code = "mmlu_vi"
38
+ name = "MMLU"
39
+ metric = "acc_norm"
40
+ higher_is_better = True
41
+ num_fewshot = 5
42
+
43
+
44
+ class TruthfulQA(Task):
45
+ code = "truthfulqa_vi"
46
+ name = "TruthfulQA"
47
+ metric = "mc2"
48
+ higher_is_better = True
49
+ num_fewshot = 0
50
+
51
+
52
+ class Grade12Exams(Task):
53
+ code = "grade_12_exams_vi"
54
+ name = "Grade 12 Exams"
55
+ metric = "acc_norm"
56
+ higher_is_better = True
57
+ num_fewshot = 5
58
+
59
+
60
+ class IWSLT2023_en_vi(Task):
61
+ code = "translation_vi"
62
+ name = "IWSLT 2023 en-vi"
63
+ metric = "bleu"
64
+ higher_is_better = True
65
+ num_fewshot = 0
66
+
67
+
68
+ TASKS = [Lambada, Arc, HellaSwag, MMLU, TruthfulQA, Grade12Exams, IWSLT2023_en_vi]
69
+ TASK_CODES = [task.code for task in TASKS]
70
+ TASK_TO_METRIC = {task.code: task.metric for task in TASKS}