Tom Aarsen commited on
Commit
485f27b
1 Parent(s): 5613607

Fix proprietary models disappearing after model size toggling

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -2021,7 +2021,7 @@ def filter_data(search_query, model_types, model_sizes, *full_dataframes):
2021
  df = df[reduce(lambda a, b: a | b, masks)]
2022
 
2023
  # Apply the model type filtering
2024
- if model_types != MODEL_TYPES:
2025
  masks = []
2026
  for model_type in model_types:
2027
  if model_type == "Open":
@@ -2036,7 +2036,7 @@ def filter_data(search_query, model_types, model_sizes, *full_dataframes):
2036
  df = pd.DataFrame(columns=df.columns)
2037
 
2038
  # Apply the model size filtering
2039
- if model_sizes != list(NUMERIC_INTERVALS.keys()):
2040
  numeric_interval = pd.IntervalIndex(sorted([NUMERIC_INTERVALS[model_size] for model_size in model_sizes]))
2041
  sizes = df["Model Size (Million Parameters)"].replace('', 0)
2042
  mask = sizes.apply(lambda size: any(numeric_interval.contains(size)))
 
2021
  df = df[reduce(lambda a, b: a | b, masks)]
2022
 
2023
  # Apply the model type filtering
2024
+ if set(model_types) != set(MODEL_TYPES):
2025
  masks = []
2026
  for model_type in model_types:
2027
  if model_type == "Open":
 
2036
  df = pd.DataFrame(columns=df.columns)
2037
 
2038
  # Apply the model size filtering
2039
+ if set(model_sizes) != set(NUMERIC_INTERVALS.keys()):
2040
  numeric_interval = pd.IntervalIndex(sorted([NUMERIC_INTERVALS[model_size] for model_size in model_sizes]))
2041
  sizes = df["Model Size (Million Parameters)"].replace('', 0)
2042
  mask = sizes.apply(lambda size: any(numeric_interval.contains(size)))