BearSean commited on
Commit
b9fea6f
1 Parent(s): 3df8919

Update src/submission/check_validity.py

Browse files

Hello!

This is a small fix for correct model parameter size.
Because of the regex `r"(\d\.)?\d+(b|m)"`, sometimes it returns wrong model size if it tries to extract model size from its name.

For example, `Sao10K/Frostwind-10.7B-v1` currently has 0.7 param size in the leaderboard, which is wrong.

I hope this improves leaderboard accuracy a bit!

Cheers

Files changed (1) hide show
  1. src/submission/check_validity.py +1 -1
src/submission/check_validity.py CHANGED
@@ -65,7 +65,7 @@ def is_model_on_hub(model_name: str, revision: str, token: str = None, trust_rem
65
 
66
 
67
  def get_model_size(model_info: ModelInfo, precision: str):
68
- size_pattern = size_pattern = re.compile(r"(\d\.)?\d+(b|m)")
69
  try:
70
  model_size = round(model_info.safetensors["total"] / 1e9, 3)
71
  except (AttributeError, TypeError ):
 
65
 
66
 
67
  def get_model_size(model_info: ModelInfo, precision: str):
68
+ size_pattern = size_pattern = re.compile(r"(\d+\.)?\d+(b|m)")
69
  try:
70
  model_size = round(model_info.safetensors["total"] / 1e9, 3)
71
  except (AttributeError, TypeError ):