future-xy commited on
Commit
5373bd7
1 Parent(s): 33e1c9d

fix display bug

Browse files
Files changed (2) hide show
  1. app.py +4 -5
  2. src/display/utils.py +10 -10
app.py CHANGED
@@ -29,7 +29,6 @@ from src.display.utils import (
29
  COLS,
30
  EVAL_COLS,
31
  EVAL_TYPES,
32
- NUMERIC_INTERVALS,
33
  TYPES,
34
  AutoEvalColumn,
35
  ModelType,
@@ -137,10 +136,10 @@ def filter_models(df: pd.DataFrame, type_query: list, size_query: list, precisio
137
  filtered_df = filtered_df.loc[df[AutoEvalColumn.model_type_symbol.name].isin(type_emoji)]
138
  filtered_df = filtered_df.loc[df[AutoEvalColumn.precision.name].isin(precision_query + ["None"])]
139
 
140
- numeric_interval = pd.IntervalIndex(sorted([NUMERIC_INTERVALS[s] for s in size_query]))
141
- params_column = pd.to_numeric(df[AutoEvalColumn.params.name], errors="coerce")
142
- mask = params_column.apply(lambda x: any(numeric_interval.contains(x)))
143
- filtered_df = filtered_df.loc[mask]
144
 
145
  return filtered_df
146
 
 
29
  COLS,
30
  EVAL_COLS,
31
  EVAL_TYPES,
 
32
  TYPES,
33
  AutoEvalColumn,
34
  ModelType,
 
136
  filtered_df = filtered_df.loc[df[AutoEvalColumn.model_type_symbol.name].isin(type_emoji)]
137
  filtered_df = filtered_df.loc[df[AutoEvalColumn.precision.name].isin(precision_query + ["None"])]
138
 
139
+ # numeric_interval = pd.IntervalIndex(sorted([NUMERIC_INTERVALS[s] for s in size_query]))
140
+ # params_column = pd.to_numeric(df[AutoEvalColumn.params.name], errors="coerce")
141
+ # mask = params_column.apply(lambda x: any(numeric_interval.contains(x)))
142
+ # filtered_df = filtered_df.loc[mask]
143
 
144
  return filtered_df
145
 
src/display/utils.py CHANGED
@@ -193,13 +193,13 @@ EVAL_TYPES = [c.type for c in fields(EvalQueueColumn)]
193
 
194
  BENCHMARK_COLS = [t.value.col_name for t in Tasks]
195
 
196
- NUMERIC_INTERVALS = {
197
- "?": pd.Interval(-1, 0, closed="right"),
198
- "~1.5": pd.Interval(0, 2, closed="right"),
199
- "~3": pd.Interval(2, 4, closed="right"),
200
- "~7": pd.Interval(4, 9, closed="right"),
201
- "~13": pd.Interval(9, 20, closed="right"),
202
- "~35": pd.Interval(20, 45, closed="right"),
203
- "~60": pd.Interval(45, 70, closed="right"),
204
- "70+": pd.Interval(70, 10000, closed="right"),
205
- }
 
193
 
194
  BENCHMARK_COLS = [t.value.col_name for t in Tasks]
195
 
196
+ # NUMERIC_INTERVALS = {
197
+ # "?": pd.Interval(-1, 0, closed="right"),
198
+ # "~1.5": pd.Interval(0, 2, closed="right"),
199
+ # "~3": pd.Interval(2, 4, closed="right"),
200
+ # "~7": pd.Interval(4, 9, closed="right"),
201
+ # "~13": pd.Interval(9, 20, closed="right"),
202
+ # "~35": pd.Interval(20, 45, closed="right"),
203
+ # "~60": pd.Interval(45, 70, closed="right"),
204
+ # "70+": pd.Interval(70, 10000, closed="right"),
205
+ # }