lvkaokao commited on
Commit
a623a77
β€’
1 Parent(s): 29e8de5

display detail results.

Browse files
src/display/formatting.py CHANGED
@@ -11,15 +11,17 @@ def model_hyperlink(link, model_name):
11
  return f'<a target="_blank" href="{link}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{model_name}</a>'
12
 
13
 
14
- def make_clickable_model(model_name):
15
  link = f"https://huggingface.co/{model_name}"
16
 
17
- details_model_name = model_name.replace("/", "__")
18
- details_link = f"https://huggingface.co/datasets/Intel/ld_results"
 
 
 
19
 
20
  return model_hyperlink(link, model_name) + " " + model_hyperlink(details_link, "πŸ“‘")
21
 
22
-
23
  def styled_error(error):
24
  return f"<p style='color: red; font-size: 20px; text-align: center;'>{error}</p>"
25
 
 
11
  return f'<a target="_blank" href="{link}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{model_name}</a>'
12
 
13
 
14
+ def make_clickable_model(model_name, result_file=""):
15
  link = f"https://huggingface.co/{model_name}"
16
 
17
+ # details_model_name = model_name.replace("/", "__")
18
+ if result_file == "":
19
+ details_link = f"https://huggingface.co/datasets/Intel/ld_results"
20
+ else:
21
+ details_link = f"https://huggingface.co/datasets/Intel/ld_results/blob/main/{result_file}"
22
 
23
  return model_hyperlink(link, model_name) + " " + model_hyperlink(details_link, "πŸ“‘")
24
 
 
25
  def styled_error(error):
26
  return f"<p style='color: red; font-size: 20px; text-align: center;'>{error}</p>"
27
 
src/leaderboard/read_evals.py CHANGED
@@ -41,10 +41,13 @@ class EvalResult:
41
  flagged: bool = False
42
  status: str = "Finished"
43
  tags: list = None
 
44
 
45
  @classmethod
46
  def init_from_json_file(self, json_filepath):
47
  """Inits the result from the specific model result file"""
 
 
48
  with open(json_filepath) as fp:
49
  data = json.load(fp)
50
 
@@ -114,7 +117,8 @@ class EvalResult:
114
  revision=config.get("model_sha", "main"),
115
  num_params=model_params,
116
  model_size=model_size,
117
- group_size=group_size
 
118
  )
119
 
120
  def update_with_request_file(self, requests_path):
@@ -159,7 +163,7 @@ class EvalResult:
159
  AutoEvalColumn.model_type.name: self.model_type.value.name,
160
  AutoEvalColumn.weight_type.name: self.weight_type.value.name,
161
  AutoEvalColumn.architecture.name: self.architecture,
162
- AutoEvalColumn.model.name: make_clickable_model(self.full_model),
163
  AutoEvalColumn.dummy.name: self.full_model,
164
  AutoEvalColumn.revision.name: self.revision,
165
  AutoEvalColumn.average.name: average,
 
41
  flagged: bool = False
42
  status: str = "Finished"
43
  tags: list = None
44
+ result_file: str = ""
45
 
46
  @classmethod
47
  def init_from_json_file(self, json_filepath):
48
  """Inits the result from the specific model result file"""
49
+
50
+ result_file = "/".join(json_filepath.split("/")[2:])
51
  with open(json_filepath) as fp:
52
  data = json.load(fp)
53
 
 
117
  revision=config.get("model_sha", "main"),
118
  num_params=model_params,
119
  model_size=model_size,
120
+ group_size=group_size,
121
+ result_file=result_file
122
  )
123
 
124
  def update_with_request_file(self, requests_path):
 
163
  AutoEvalColumn.model_type.name: self.model_type.value.name,
164
  AutoEvalColumn.weight_type.name: self.weight_type.value.name,
165
  AutoEvalColumn.architecture.name: self.architecture,
166
+ AutoEvalColumn.model.name: make_clickable_model(self.full_model, self.result_file),
167
  AutoEvalColumn.dummy.name: self.full_model,
168
  AutoEvalColumn.revision.name: self.revision,
169
  AutoEvalColumn.average.name: average,