bugfix
Browse files- requirements.txt +1 -2
- src/about.py +2 -1
- src/display/utils.py +13 -1
- src/leaderboard/read_evals.py +5 -2
requirements.txt
CHANGED
@@ -13,6 +13,5 @@ requests==2.28.2
|
|
13 |
tqdm==4.65.0
|
14 |
transformers==4.35.2
|
15 |
tokenizers>=0.15.0
|
16 |
-
git+https://github.com/EleutherAI/lm-evaluation-harness.git@b281b0921b636bc36ad05c0b0b0763bd6dd43463#egg=lm-eval
|
17 |
accelerate==0.24.1
|
18 |
-
sentencepiece
|
|
|
13 |
tqdm==4.65.0
|
14 |
transformers==4.35.2
|
15 |
tokenizers>=0.15.0
|
|
|
16 |
accelerate==0.24.1
|
17 |
+
sentencepiece
|
src/about.py
CHANGED
@@ -25,7 +25,8 @@ class Tasks(Enum):
|
|
25 |
task7 = Task("itacola", "mcc,none", "ItaCoLA", scale_by_100=False)
|
26 |
task8 = Task("news_sum", "bertscore,none", "News Sum")
|
27 |
task9 = Task("squad_it", "squad_f1,get-answer", "SQuAD it")
|
28 |
-
task10 = Task("
|
|
|
29 |
|
30 |
|
31 |
NUM_FEWSHOT = 0 # Change with your few shot
|
|
|
25 |
task7 = Task("itacola", "mcc,none", "ItaCoLA", scale_by_100=False)
|
26 |
task8 = Task("news_sum", "bertscore,none", "News Sum")
|
27 |
task9 = Task("squad_it", "squad_f1,get-answer", "SQuAD it")
|
28 |
+
task10 = Task("truthfulqa_mc2_ita", "acc,none", "TruthfulQA")
|
29 |
+
task11 = Task("xcopa_it", "acc,none", "TruthfulQA")
|
30 |
|
31 |
|
32 |
NUM_FEWSHOT = 0 # Change with your few shot
|
src/display/utils.py
CHANGED
@@ -13,7 +13,7 @@ def fields(raw_class):
|
|
13 |
# These classes are for user facing column names,
|
14 |
# to avoid having to change them all around the code
|
15 |
# when a modif is needed
|
16 |
-
@dataclass
|
17 |
class ColumnContent:
|
18 |
name: str
|
19 |
type: str
|
@@ -114,6 +114,18 @@ class WeightType(Enum):
|
|
114 |
Adapter = ModelDetails("Adapter")
|
115 |
Original = ModelDetails("Original")
|
116 |
Delta = ModelDetails("Delta")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
|
118 |
|
119 |
class Precision(Enum):
|
|
|
13 |
# These classes are for user facing column names,
|
14 |
# to avoid having to change them all around the code
|
15 |
# when a modif is needed
|
16 |
+
@dataclass(frozen=True)
|
17 |
class ColumnContent:
|
18 |
name: str
|
19 |
type: str
|
|
|
114 |
Adapter = ModelDetails("Adapter")
|
115 |
Original = ModelDetails("Original")
|
116 |
Delta = ModelDetails("Delta")
|
117 |
+
Unknown = ModelDetails("Unknown")
|
118 |
+
|
119 |
+
@staticmethod
|
120 |
+
def from_str(type):
|
121 |
+
if type == "adapter":
|
122 |
+
return WeightType.Adapter
|
123 |
+
elif type == "original":
|
124 |
+
return WeightType.Original
|
125 |
+
elif type == "delta":
|
126 |
+
return WeightType.Delta
|
127 |
+
else:
|
128 |
+
return WeightType.Unknown
|
129 |
|
130 |
|
131 |
class Precision(Enum):
|
src/leaderboard/read_evals.py
CHANGED
@@ -48,7 +48,7 @@ class EvalResult:
|
|
48 |
"num_params": config.get("params", None),
|
49 |
"base_model": config.get("base_model", None),
|
50 |
"model_type": ModelType.from_str(config.get("model_type", "")),
|
51 |
-
"weight_type": WeightType
|
52 |
"training_codebase": DisclosedType.from_str(config.get("training_codebase", "")),
|
53 |
"training_data": DisclosedType.from_str(config.get("training_data", "")),
|
54 |
}
|
@@ -57,7 +57,7 @@ class EvalResult:
|
|
57 |
precision = Precision.from_str(config.get("model_dtype"))
|
58 |
|
59 |
# Get model and org
|
60 |
-
org_and_model = config.get("model_name", config.get("model_args", None))
|
61 |
org_and_model = org_and_model.split("/", 1)
|
62 |
|
63 |
if len(org_and_model) == 1:
|
@@ -197,6 +197,9 @@ def get_raw_eval_results(results_path: str, requests_path: str) -> list[EvalResu
|
|
197 |
for file in files:
|
198 |
model_result_filepaths.append(os.path.join(root, file))
|
199 |
|
|
|
|
|
|
|
200 |
eval_results = {}
|
201 |
for model_result_filepath in model_result_filepaths:
|
202 |
# Creation of result
|
|
|
48 |
"num_params": config.get("params", None),
|
49 |
"base_model": config.get("base_model", None),
|
50 |
"model_type": ModelType.from_str(config.get("model_type", "")),
|
51 |
+
"weight_type": WeightType.from_str(config.get("weight_type", "")),
|
52 |
"training_codebase": DisclosedType.from_str(config.get("training_codebase", "")),
|
53 |
"training_data": DisclosedType.from_str(config.get("training_data", "")),
|
54 |
}
|
|
|
57 |
precision = Precision.from_str(config.get("model_dtype"))
|
58 |
|
59 |
# Get model and org
|
60 |
+
org_and_model = config.get("model_name", data.get("model_name", config.get("model_args", None)))
|
61 |
org_and_model = org_and_model.split("/", 1)
|
62 |
|
63 |
if len(org_and_model) == 1:
|
|
|
197 |
for file in files:
|
198 |
model_result_filepaths.append(os.path.join(root, file))
|
199 |
|
200 |
+
# Exclude any "samples_* file"
|
201 |
+
model_result_filepaths = [m for m in model_result_filepaths if not os.path.basename(m).startswith("samples_")]
|
202 |
+
|
203 |
eval_results = {}
|
204 |
for model_result_filepath in model_result_filepaths:
|
205 |
# Creation of result
|