lvkaokao commited on
Commit
c3c6a41
β€’
1 Parent(s): b10d6d4

update model size filter.

Browse files
Files changed (2) hide show
  1. app.py +8 -7
  2. src/display/utils.py +9 -1
app.py CHANGED
@@ -23,6 +23,7 @@ from src.display.utils import (
23
  EVAL_COLS,
24
  EVAL_TYPES,
25
  NUMERIC_INTERVALS,
 
26
  TYPES,
27
  AutoEvalColumn,
28
  GroupDtype,
@@ -203,8 +204,8 @@ def filter_models(
203
  mask = params_column.apply(lambda x: any(numeric_interval.contains(x)))
204
  filtered_df = filtered_df.loc[mask]
205
 
206
- numeric_interval_params = pd.IntervalIndex(sorted([NUMERIC_INTERVALS[s] for s in params_query]))
207
- params_column_params = pd.to_numeric(df[AutoEvalColumn.params.name], errors="coerce")
208
  mask_params = params_column_params.apply(lambda x: any(numeric_interval_params.contains(x)))
209
  filtered_df = filtered_df.loc[mask_params]
210
 
@@ -214,7 +215,7 @@ leaderboard_df = filter_models(
214
  df=leaderboard_df,
215
  type_query=[t.to_str(" : ") for t in QuantType],
216
  size_query=list(NUMERIC_INTERVALS.keys()),
217
- params_query=list(NUMERIC_INTERVALS.keys()),
218
  precision_query=[i.value.name for i in Precision],
219
  hide_models=["Private or deleted", "Contains a merge/moerge", "Flagged"], # Deleted, merges, flagged, MoEs,
220
  compute_dtype=[i.value.name for i in ComputeDtype],
@@ -266,8 +267,8 @@ with demo:
266
  with gr.Row():
267
  filter_columns_size = gr.CheckboxGroup(
268
  label="Model sizes (GB, int4)",
269
- choices=list(NUMERIC_INTERVALS.keys()),
270
- value=list(NUMERIC_INTERVALS.keys()),
271
  interactive=True,
272
  elem_id="filter-columns-size",
273
  )
@@ -333,8 +334,8 @@ with demo:
333
  shown_columns,
334
  filter_columns_type,
335
  filter_columns_precision,
336
- filter_columns_size,
337
  filter_columns_parameters,
 
338
  hide_models,
339
  search_bar,
340
  filter_columns_computeDtype,
@@ -377,8 +378,8 @@ with demo:
377
  shown_columns,
378
  filter_columns_type,
379
  filter_columns_precision,
380
- filter_columns_size,
381
  filter_columns_parameters,
 
382
  hide_models,
383
  search_bar,
384
  filter_columns_computeDtype,
 
23
  EVAL_COLS,
24
  EVAL_TYPES,
25
  NUMERIC_INTERVALS,
26
+ NUMERIC_MODELSIZE,
27
  TYPES,
28
  AutoEvalColumn,
29
  GroupDtype,
 
204
  mask = params_column.apply(lambda x: any(numeric_interval.contains(x)))
205
  filtered_df = filtered_df.loc[mask]
206
 
207
+ numeric_interval_params = pd.IntervalIndex(sorted([NUMERIC_MODELSIZE[s] for s in params_query]))
208
+ params_column_params = pd.to_numeric(df[AutoEvalColumn.model_size.name], errors="coerce")
209
  mask_params = params_column_params.apply(lambda x: any(numeric_interval_params.contains(x)))
210
  filtered_df = filtered_df.loc[mask_params]
211
 
 
215
  df=leaderboard_df,
216
  type_query=[t.to_str(" : ") for t in QuantType],
217
  size_query=list(NUMERIC_INTERVALS.keys()),
218
+ params_query=list(NUMERIC_MODELSIZE.keys()),
219
  precision_query=[i.value.name for i in Precision],
220
  hide_models=["Private or deleted", "Contains a merge/moerge", "Flagged"], # Deleted, merges, flagged, MoEs,
221
  compute_dtype=[i.value.name for i in ComputeDtype],
 
267
  with gr.Row():
268
  filter_columns_size = gr.CheckboxGroup(
269
  label="Model sizes (GB, int4)",
270
+ choices=list(NUMERIC_MODELSIZE.keys()),
271
+ value=list(NUMERIC_MODELSIZE.keys()),
272
  interactive=True,
273
  elem_id="filter-columns-size",
274
  )
 
334
  shown_columns,
335
  filter_columns_type,
336
  filter_columns_precision,
 
337
  filter_columns_parameters,
338
+ filter_columns_size,
339
  hide_models,
340
  search_bar,
341
  filter_columns_computeDtype,
 
378
  shown_columns,
379
  filter_columns_type,
380
  filter_columns_precision,
 
381
  filter_columns_parameters,
382
+ filter_columns_size,
383
  hide_models,
384
  search_bar,
385
  filter_columns_computeDtype,
src/display/utils.py CHANGED
@@ -208,7 +208,7 @@ class QuantType(Enum):
208
  awq = ModelDetails(name="AWQ", symbol="🟩")
209
  llama_cpp = ModelDetails(name="llama.cpp", symbol="πŸ”Ά")
210
  bnb = ModelDetails(name="bitsandbytes", symbol="πŸ’¬")
211
- autoround = ModelDetails(name="AutoRound", symbol="🌐")
212
  Unknown = ModelDetails(name="?", symbol="?")
213
 
214
  def to_str(self, separator=" "):
@@ -343,3 +343,11 @@ NUMERIC_INTERVALS = {
343
  # "~60": pd.Interval(45, 70, closed="right"),
344
  # "70+": pd.Interval(70, 10000, closed="right"),
345
  }
 
 
 
 
 
 
 
 
 
208
  awq = ModelDetails(name="AWQ", symbol="🟩")
209
  llama_cpp = ModelDetails(name="llama.cpp", symbol="πŸ”Ά")
210
  bnb = ModelDetails(name="bitsandbytes", symbol="πŸ’¬")
211
+ autoround = ModelDetails(name="AutoRound", symbol="πŸ’")
212
  Unknown = ModelDetails(name="?", symbol="?")
213
 
214
  def to_str(self, separator=" "):
 
343
  # "~60": pd.Interval(45, 70, closed="right"),
344
  # "70+": pd.Interval(70, 10000, closed="right"),
345
  }
346
+
347
+ NUMERIC_MODELSIZE = {
348
+ "?": pd.Interval(-1, 0, closed="right"),
349
+ "~4": pd.Interval(0, 4, closed="right"),
350
+ "~8": pd.Interval(4, 8, closed="right"),
351
+ "~16": pd.Interval(8, 16, closed="right"),
352
+ "~36": pd.Interval(16, 36, closed="right"),
353
+ }