Clémentine commited on
Commit
6e79cea
1 Parent(s): 1d49827

fixes display for model params that are 0

Browse files
src/display_models/get_model_metadata.py CHANGED
@@ -22,8 +22,8 @@ def get_model_infos_from_hub(leaderboard_data: List[dict]):
22
  model_info = api.model_info(model_name)
23
  except huggingface_hub.utils._errors.RepositoryNotFoundError:
24
  print("Repo not found!", model_name)
25
- model_data[AutoEvalColumn.license.name] = None
26
- model_data[AutoEvalColumn.likes.name] = None
27
  model_data[AutoEvalColumn.params.name] = get_model_size(model_name, None)
28
  continue
29
 
@@ -36,7 +36,7 @@ def get_model_license(model_info):
36
  try:
37
  return model_info.cardData["license"]
38
  except Exception:
39
- return None
40
 
41
 
42
  def get_model_likes(model_info):
@@ -56,7 +56,7 @@ def get_model_size(model_name, model_info):
56
  size = size_match.group(0)
57
  return round(float(size[:-1]) if size[-1] == "b" else float(size[:-1]) / 1e3, 3)
58
  except AttributeError:
59
- return None
60
 
61
 
62
  def get_model_type(leaderboard_data: List[dict]):
 
22
  model_info = api.model_info(model_name)
23
  except huggingface_hub.utils._errors.RepositoryNotFoundError:
24
  print("Repo not found!", model_name)
25
+ model_data[AutoEvalColumn.license.name] = "?"
26
+ model_data[AutoEvalColumn.likes.name] = 0
27
  model_data[AutoEvalColumn.params.name] = get_model_size(model_name, None)
28
  continue
29
 
 
36
  try:
37
  return model_info.cardData["license"]
38
  except Exception:
39
+ return "?"
40
 
41
 
42
  def get_model_likes(model_info):
 
56
  size = size_match.group(0)
57
  return round(float(size[:-1]) if size[-1] == "b" else float(size[:-1]) / 1e3, 3)
58
  except AttributeError:
59
+ return 0
60
 
61
 
62
  def get_model_type(leaderboard_data: List[dict]):
src/display_models/read_results.py CHANGED
@@ -27,7 +27,7 @@ class EvalResult:
27
  results: dict
28
  precision: str = ""
29
  model_type: str = ""
30
- weight_type: str = ""
31
  date: str = ""
32
 
33
  def to_dict(self):
 
27
  results: dict
28
  precision: str = ""
29
  model_type: str = ""
30
+ weight_type: str = "Original"
31
  date: str = ""
32
 
33
  def to_dict(self):