Nathan Habib commited on
Commit
bc44e71
2 Parent(s): 0799cf8 6e79cea

Merge branch 'main' of https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard

Browse files
app.py CHANGED
@@ -216,22 +216,14 @@ def change_tab(query_param: str):
216
  # Searching and filtering
217
  def update_table(hidden_df: pd.DataFrame, current_columns_df: pd.DataFrame, columns: list, type_query: list, size_query: list, show_deleted: bool, query: str):
218
  filtered_df = filter_models(hidden_df, type_query, size_query, show_deleted)
219
- df = search_table(filtered_df, current_columns_df, query)
220
- df = select_columns(df, columns)
 
221
 
222
  return df
223
 
224
- def search_table(df: pd.DataFrame, current_columns_df: pd.DataFrame, query: str) -> pd.DataFrame:
225
- current_columns = current_columns_df.columns
226
- if AutoEvalColumn.model_type.name in current_columns:
227
- filtered_df = df[
228
- (df[AutoEvalColumn.dummy.name].str.contains(query, case=False))
229
- | (df[AutoEvalColumn.model_type.name].str.contains(query, case=False))
230
- ]
231
- else:
232
- filtered_df = df[(df[AutoEvalColumn.dummy.name].str.contains(query, case=False))]
233
-
234
- return filtered_df
235
 
236
  def select_columns(df: pd.DataFrame, columns: list) -> pd.DataFrame:
237
  always_here_cols = [
 
216
  # Searching and filtering
217
  def update_table(hidden_df: pd.DataFrame, current_columns_df: pd.DataFrame, columns: list, type_query: list, size_query: list, show_deleted: bool, query: str):
218
  filtered_df = filter_models(hidden_df, type_query, size_query, show_deleted)
219
+ if query != "":
220
+ filtered_df = search_table(filtered_df, query)
221
+ df = select_columns(filtered_df, columns)
222
 
223
  return df
224
 
225
+ def search_table(df: pd.DataFrame, query: str) -> pd.DataFrame:
226
+ return df[(df[AutoEvalColumn.dummy.name].str.contains(query, case=False))]
 
 
 
 
 
 
 
 
 
227
 
228
  def select_columns(df: pd.DataFrame, columns: list) -> pd.DataFrame:
229
  always_here_cols = [
src/display_models/get_model_metadata.py CHANGED
@@ -26,6 +26,7 @@ def get_model_infos_from_hub(leaderboard_data: List[dict]):
26
 
27
  for model_data in tqdm(leaderboard_data):
28
  model_name = model_data["model_name_for_query"]
 
29
 
30
  if model_name in model_info_cache:
31
  model_info = model_info_cache[model_name]
@@ -39,6 +40,16 @@ def get_model_infos_from_hub(leaderboard_data: List[dict]):
39
  model_data[AutoEvalColumn.likes.name] = None
40
  model_data[AutoEvalColumn.params.name] = get_model_size(model_name, None)
41
  continue
 
 
 
 
 
 
 
 
 
 
42
 
43
  model_data[AutoEvalColumn.license.name] = get_model_license(model_info)
44
  model_data[AutoEvalColumn.likes.name] = get_model_likes(model_info)
@@ -53,7 +64,7 @@ def get_model_license(model_info):
53
  try:
54
  return model_info.cardData["license"]
55
  except Exception:
56
- return None
57
 
58
 
59
  def get_model_likes(model_info):
@@ -73,7 +84,7 @@ def get_model_size(model_name, model_info):
73
  size = size_match.group(0)
74
  return round(float(size[:-1]) if size[-1] == "b" else float(size[:-1]) / 1e3, 3)
75
  except AttributeError:
76
- return None
77
 
78
 
79
  def get_model_type(leaderboard_data: List[dict]):
 
26
 
27
  for model_data in tqdm(leaderboard_data):
28
  model_name = model_data["model_name_for_query"]
29
+ <<<<<<< HEAD
30
 
31
  if model_name in model_info_cache:
32
  model_info = model_info_cache[model_name]
 
40
  model_data[AutoEvalColumn.likes.name] = None
41
  model_data[AutoEvalColumn.params.name] = get_model_size(model_name, None)
42
  continue
43
+ =======
44
+ try:
45
+ model_info = api.model_info(model_name)
46
+ except huggingface_hub.utils._errors.RepositoryNotFoundError:
47
+ print("Repo not found!", model_name)
48
+ model_data[AutoEvalColumn.license.name] = "?"
49
+ model_data[AutoEvalColumn.likes.name] = 0
50
+ model_data[AutoEvalColumn.params.name] = get_model_size(model_name, None)
51
+ continue
52
+ >>>>>>> 6e79cea283b9033350b77806ca64c34a2e0cd323
53
 
54
  model_data[AutoEvalColumn.license.name] = get_model_license(model_info)
55
  model_data[AutoEvalColumn.likes.name] = get_model_likes(model_info)
 
64
  try:
65
  return model_info.cardData["license"]
66
  except Exception:
67
+ return "?"
68
 
69
 
70
  def get_model_likes(model_info):
 
84
  size = size_match.group(0)
85
  return round(float(size[:-1]) if size[-1] == "b" else float(size[:-1]) / 1e3, 3)
86
  except AttributeError:
87
+ return 0
88
 
89
 
90
  def get_model_type(leaderboard_data: List[dict]):
src/display_models/model_metadata_type.py CHANGED
@@ -22,6 +22,8 @@ class ModelType(Enum):
22
 
23
  MODEL_TYPE_METADATA: Dict[str, ModelType] = {
24
  "tiiuae/falcon-180B": ModelType.PT,
 
 
25
  "Qwen/Qwen-7B": ModelType.PT,
26
  "Qwen/Qwen-7B-Chat": ModelType.RL,
27
  "notstoic/PygmalionCoT-7b": ModelType.IFT,
 
22
 
23
  MODEL_TYPE_METADATA: Dict[str, ModelType] = {
24
  "tiiuae/falcon-180B": ModelType.PT,
25
+ "tiiuae/falcon-180B-chat": ModelType.RL,
26
+ "microsoft/phi-1_5": ModelType.PT,
27
  "Qwen/Qwen-7B": ModelType.PT,
28
  "Qwen/Qwen-7B-Chat": ModelType.RL,
29
  "notstoic/PygmalionCoT-7b": ModelType.IFT,
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):