Spaces:
Restarting
on
CPU Upgrade
Restarting
on
CPU Upgrade
n-shot filter
Browse files- src/about.py +1 -1
- src/display/utils.py +9 -1
- src/leaderboard/read_evals.py +4 -4
src/about.py
CHANGED
@@ -37,7 +37,7 @@ NUM_FEWSHOT = 0 # Change with your few shot
|
|
37 |
|
38 |
|
39 |
# Your leaderboard name
|
40 |
-
TITLE = """<h1 align="center" id="space-title">Open PL LLM Leaderboard (0-shot)</h1>"""
|
41 |
|
42 |
# What does your leaderboard evaluate?
|
43 |
INTRODUCTION_TEXT = """
|
|
|
37 |
|
38 |
|
39 |
# Your leaderboard name
|
40 |
+
TITLE = """<h1 align="center" id="space-title">Open PL LLM Leaderboard (0-shot and 5-shot)</h1>"""
|
41 |
|
42 |
# What does your leaderboard evaluate?
|
43 |
INTRODUCTION_TEXT = """
|
src/display/utils.py
CHANGED
@@ -26,7 +26,7 @@ auto_eval_column_dict = []
|
|
26 |
# Init
|
27 |
auto_eval_column_dict.append(["model_type_symbol", ColumnContent, ColumnContent("T", "str", True, never_hidden=True)])
|
28 |
auto_eval_column_dict.append(["model", ColumnContent, ColumnContent("Model", "markdown", True, never_hidden=True)])
|
29 |
-
auto_eval_column_dict.append(["n_shot", ColumnContent, ColumnContent("n_shot", "
|
30 |
#Scores
|
31 |
auto_eval_column_dict.append(["average", ColumnContent, ColumnContent("Average ⬆️", "number", True)])
|
32 |
for task in Tasks:
|
@@ -96,6 +96,14 @@ class NShotType(Enum):
|
|
96 |
n0 = ModelDetails("0")
|
97 |
n5 = ModelDetails("5")
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
class Precision(Enum):
|
100 |
float16 = ModelDetails("float16")
|
101 |
bfloat16 = ModelDetails("bfloat16")
|
|
|
26 |
# Init
|
27 |
auto_eval_column_dict.append(["model_type_symbol", ColumnContent, ColumnContent("T", "str", True, never_hidden=True)])
|
28 |
auto_eval_column_dict.append(["model", ColumnContent, ColumnContent("Model", "markdown", True, never_hidden=True)])
|
29 |
+
auto_eval_column_dict.append(["n_shot", ColumnContent, ColumnContent("n_shot", "str", True)])
|
30 |
#Scores
|
31 |
auto_eval_column_dict.append(["average", ColumnContent, ColumnContent("Average ⬆️", "number", True)])
|
32 |
for task in Tasks:
|
|
|
96 |
n0 = ModelDetails("0")
|
97 |
n5 = ModelDetails("5")
|
98 |
|
99 |
+
@staticmethod
|
100 |
+
def from_str(n):
|
101 |
+
if n in ["0", 0]:
|
102 |
+
return NShotType.n0
|
103 |
+
if n in ["5", 5]:
|
104 |
+
return NShotType.n5
|
105 |
+
return NShotType.Unknown
|
106 |
+
|
107 |
class Precision(Enum):
|
108 |
float16 = ModelDetails("float16")
|
109 |
bfloat16 = ModelDetails("bfloat16")
|
src/leaderboard/read_evals.py
CHANGED
@@ -9,7 +9,7 @@ import dateutil
|
|
9 |
import numpy as np
|
10 |
|
11 |
from src.display.formatting import make_clickable_model
|
12 |
-
from src.display.utils import AutoEvalColumn, ModelType, Tasks, Precision, WeightType
|
13 |
from src.submission.check_validity import is_model_on_hub
|
14 |
|
15 |
NUM_FEWSHOT = 0
|
@@ -31,7 +31,7 @@ class EvalResult:
|
|
31 |
num_params: int = 0
|
32 |
date: str = "" # submission date of request file
|
33 |
still_on_hub: bool = False
|
34 |
-
n_shot:
|
35 |
|
36 |
@classmethod
|
37 |
def init_from_json_file(self, json_filepath, n_shot_num):
|
@@ -92,7 +92,7 @@ class EvalResult:
|
|
92 |
revision= config.get("model_sha", ""),
|
93 |
still_on_hub=still_on_hub,
|
94 |
architecture=architecture,
|
95 |
-
n_shot=n_shot_num
|
96 |
)
|
97 |
|
98 |
def update_with_request_file(self, requests_path):
|
@@ -203,7 +203,7 @@ class EvalResult:
|
|
203 |
print(f"Could not find still on hub")
|
204 |
|
205 |
try:
|
206 |
-
data_dict[AutoEvalColumn.n_shot.name] = self.n_shot
|
207 |
except KeyError:
|
208 |
print(f"Could not find still on hub")
|
209 |
|
|
|
9 |
import numpy as np
|
10 |
|
11 |
from src.display.formatting import make_clickable_model
|
12 |
+
from src.display.utils import AutoEvalColumn, ModelType, Tasks, Precision, WeightType, NShotType
|
13 |
from src.submission.check_validity import is_model_on_hub
|
14 |
|
15 |
NUM_FEWSHOT = 0
|
|
|
31 |
num_params: int = 0
|
32 |
date: str = "" # submission date of request file
|
33 |
still_on_hub: bool = False
|
34 |
+
n_shot: NShotType = NShotType.n0
|
35 |
|
36 |
@classmethod
|
37 |
def init_from_json_file(self, json_filepath, n_shot_num):
|
|
|
92 |
revision= config.get("model_sha", ""),
|
93 |
still_on_hub=still_on_hub,
|
94 |
architecture=architecture,
|
95 |
+
n_shot=NShotType.from_str(n_shot_num)
|
96 |
)
|
97 |
|
98 |
def update_with_request_file(self, requests_path):
|
|
|
203 |
print(f"Could not find still on hub")
|
204 |
|
205 |
try:
|
206 |
+
data_dict[AutoEvalColumn.n_shot.name] = self.n_shot.value.name
|
207 |
except KeyError:
|
208 |
print(f"Could not find still on hub")
|
209 |
|