Spaces:
Runtime error
Runtime error
Clémentine
commited on
Commit
•
dc0413f
1
Parent(s):
adc89b4
fixed bug in #277
Browse files- app.py +9 -8
- model_info_cache.pkl +2 -2
app.py
CHANGED
@@ -237,12 +237,12 @@ def select_columns(df: pd.DataFrame, columns: list) -> pd.DataFrame:
|
|
237 |
return filtered_df
|
238 |
|
239 |
NUMERIC_INTERVALS = {
|
240 |
-
"< 1.5B": (0, 1.5),
|
241 |
-
"~3B": (1.5, 5),
|
242 |
-
"~7B": (6, 11),
|
243 |
-
"~13B": (12, 15),
|
244 |
-
"~35B": (16, 55),
|
245 |
-
"60B+": (55, 10000),
|
246 |
}
|
247 |
|
248 |
def filter_models(
|
@@ -257,9 +257,10 @@ def filter_models(
|
|
257 |
type_emoji = [t[0] for t in type_query]
|
258 |
filtered_df = filtered_df[df[AutoEvalColumn.model_type_symbol.name].isin(type_emoji)]
|
259 |
|
260 |
-
numeric_interval = [NUMERIC_INTERVALS[s] for s in size_query]
|
261 |
params_column = pd.to_numeric(df[AutoEvalColumn.params.name], errors="coerce")
|
262 |
-
|
|
|
263 |
|
264 |
return filtered_df
|
265 |
|
|
|
237 |
return filtered_df
|
238 |
|
239 |
NUMERIC_INTERVALS = {
|
240 |
+
"< 1.5B": pd.Interval(0, 1.5, closed="both"),
|
241 |
+
"~3B": pd.Interval(1.5, 5, closed="both"),
|
242 |
+
"~7B": pd.Interval(6, 11, closed="both"),
|
243 |
+
"~13B": pd.Interval(12, 15, closed="both"),
|
244 |
+
"~35B": pd.Interval(16, 55, closed="both"),
|
245 |
+
"60B+": pd.Interval(55, 10000, closed="both"),
|
246 |
}
|
247 |
|
248 |
def filter_models(
|
|
|
257 |
type_emoji = [t[0] for t in type_query]
|
258 |
filtered_df = filtered_df[df[AutoEvalColumn.model_type_symbol.name].isin(type_emoji)]
|
259 |
|
260 |
+
numeric_interval = pd.IntervalIndex(sorted([NUMERIC_INTERVALS[s] for s in size_query]))
|
261 |
params_column = pd.to_numeric(df[AutoEvalColumn.params.name], errors="coerce")
|
262 |
+
mask = params_column.apply(lambda x: any(numeric_interval.contains(x)))
|
263 |
+
filtered_df = filtered_df.loc[mask]
|
264 |
|
265 |
return filtered_df
|
266 |
|
model_info_cache.pkl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0afe4b74916048b8a1d0379a0a0bff55acdc6cd3583cbcc5aa42cf194d019b7a
|
3 |
+
size 2841512
|