clefourrier HF staff commited on
Commit
6254b87
β€’
1 Parent(s): 1108259

Adding link to detailed results and evals (#203)

Browse files

- adding link (948c743dea77eb779b447b2715b126ef05c12166)

requirements.txt CHANGED
@@ -24,7 +24,7 @@ gradio_client==0.1.3
24
  h11==0.14.0
25
  httpcore==0.17.0
26
  httpx==0.24.0
27
- huggingface-hub==0.13.4
28
  idna==3.4
29
  Jinja2==3.1.2
30
  jsonschema==4.17.3
 
24
  h11==0.14.0
25
  httpcore==0.17.0
26
  httpx==0.24.0
27
+ huggingface-hub==0.16.4
28
  idna==3.4
29
  Jinja2==3.1.2
30
  jsonschema==4.17.3
src/auto_leaderboard/get_model_metadata.py CHANGED
@@ -1,6 +1,7 @@
1
  import re
2
  import os
3
  from typing import List
 
4
 
5
  from src.utils_display import AutoEvalColumn
6
  from src.auto_leaderboard.model_metadata_type import get_model_type
@@ -11,7 +12,7 @@ api = HfApi(token=os.environ.get("H4_TOKEN", None))
11
 
12
 
13
  def get_model_infos_from_hub(leaderboard_data: List[dict]):
14
- for model_data in leaderboard_data:
15
  model_name = model_data["model_name_for_query"]
16
  try:
17
  model_info = api.model_info(model_name)
 
1
  import re
2
  import os
3
  from typing import List
4
+ from tqdm import tqdm
5
 
6
  from src.utils_display import AutoEvalColumn
7
  from src.auto_leaderboard.model_metadata_type import get_model_type
 
12
 
13
 
14
  def get_model_infos_from_hub(leaderboard_data: List[dict]):
15
+ for model_data in tqdm(leaderboard_data):
16
  model_name = model_data["model_name_for_query"]
17
  try:
18
  model_info = api.model_info(model_name)
src/utils_display.py CHANGED
@@ -1,4 +1,9 @@
 
1
  from dataclasses import dataclass
 
 
 
 
2
 
3
  # These classes are for user facing column names, to avoid having to change them
4
  # all around the code when a modif is needed
@@ -86,8 +91,20 @@ def make_clickable_model(model_name):
86
  link = OASST_LINK
87
  #else:
88
  # link = MODEL_PAGE
89
-
90
- return model_hyperlink(link, model_name)
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
  def styled_error(error):
93
  return f"<p style='color: red; font-size: 20px; text-align: center;'>{error}</p>"
 
1
+ import os
2
  from dataclasses import dataclass
3
+ from huggingface_hub import HfApi
4
+
5
+ API = HfApi()
6
+
7
 
8
  # These classes are for user facing column names, to avoid having to change them
9
  # all around the code when a modif is needed
 
91
  link = OASST_LINK
92
  #else:
93
  # link = MODEL_PAGE
94
+ details_model_name = model_name.replace('/', '__')
95
+ details_link = f"https://huggingface.co/datasets/open-llm-leaderboard/details_{details_model_name}"
96
+ print(f"details_link: {details_link}")
97
+ try:
98
+ check_path = list(API.list_files_info(repo_id=f"open-llm-leaderboard/details_{details_model_name}",
99
+ paths="README.md",
100
+ repo_type="dataset"))
101
+ print(f"check_path: {check_path}")
102
+ except Exception as err:
103
+ # No details repo for this model
104
+ print(f"No details repo for this model: {err}")
105
+ return model_hyperlink(link, model_name)
106
+
107
+ return model_hyperlink(link, model_name) + ' ' + model_hyperlink(details_link, "πŸ“‘")
108
 
109
  def styled_error(error):
110
  return f"<p style='color: red; font-size: 20px; text-align: center;'>{error}</p>"