FinancialSupport commited on
Commit
915c386
ยท
verified ยท
1 Parent(s): 2edf3b2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -31
app.py CHANGED
@@ -112,53 +112,51 @@ def filter_queries(query: str, filtered_df: pd.DataFrame) -> pd.DataFrame:
112
  return filtered_df
113
 
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  # def filter_models(
116
  # df: pd.DataFrame, type_query: list, size_query: list, precision_query: list, show_deleted: bool, italian_only: bool
117
  # ) -> pd.DataFrame:
118
  # # Show all models
119
  # if show_deleted:
120
- # filtered_df = df
121
  # else: # Show only still on the hub models
122
- # filtered_df = df[df[AutoEvalColumn.still_on_hub.name] == True]
 
 
123
 
124
  # type_emoji = [t[0] for t in type_query]
125
- # filtered_df = filtered_df.loc[df[AutoEvalColumn.model_type_symbol.name].isin(type_emoji)]
126
- # filtered_df = filtered_df.loc[df[AutoEvalColumn.precision.name].isin(precision_query + ["None"])]
127
 
128
  # numeric_interval = pd.IntervalIndex(sorted([NUMERIC_INTERVALS[s] for s in size_query]))
129
- # params_column = pd.to_numeric(df[AutoEvalColumn.params.name], errors="coerce")
130
  # mask = params_column.apply(lambda x: any(numeric_interval.contains(x)))
131
- # filtered_df = filtered_df.loc[mask]
 
132
  # if italian_only:
133
  # filtered_df = filtered_df[filtered_df[AutoEvalColumn.author.name] == "๐Ÿ‡ฎ๐Ÿ‡น"]
134
 
135
  # return filtered_df
136
 
137
- def filter_models(
138
- df: pd.DataFrame, type_query: list, size_query: list, precision_query: list, show_deleted: bool, italian_only: bool
139
- ) -> pd.DataFrame:
140
- # Show all models
141
- if show_deleted:
142
- filtered_df = df.copy()
143
- else: # Show only still on the hub models
144
- filtered_df = df[df[AutoEvalColumn.still_on_hub.name] == True].copy()
145
-
146
- filtered_df[AutoEvalColumn.model.name] = filtered_df[AutoEvalColumn.model.name].apply(lambda x: x.split('>')[-2].split('<')[0] if '<a' in x else x)
147
-
148
- type_emoji = [t[0] for t in type_query]
149
- filtered_df = filtered_df[filtered_df[AutoEvalColumn.model_type_symbol.name].isin(type_emoji)]
150
- filtered_df = filtered_df[filtered_df[AutoEvalColumn.precision.name].isin(precision_query + ["None"])]
151
-
152
- numeric_interval = pd.IntervalIndex(sorted([NUMERIC_INTERVALS[s] for s in size_query]))
153
- params_column = pd.to_numeric(filtered_df[AutoEvalColumn.params.name], errors="coerce")
154
- mask = params_column.apply(lambda x: any(numeric_interval.contains(x)))
155
- filtered_df = filtered_df[mask]
156
-
157
- if italian_only:
158
- filtered_df = filtered_df[filtered_df[AutoEvalColumn.author.name] == "๐Ÿ‡ฎ๐Ÿ‡น"]
159
-
160
- return filtered_df
161
-
162
  def get_data_totale():
163
  dataset = pd.read_csv("mmlu_pro_it.csv", sep=',')
164
  if 'model ' in dataset.columns:
 
112
  return filtered_df
113
 
114
 
115
+ def filter_models(
116
+ df: pd.DataFrame, type_query: list, size_query: list, precision_query: list, show_deleted: bool
117
+ ) -> pd.DataFrame:
118
+ # Show all models
119
+ if show_deleted:
120
+ filtered_df = df
121
+ else: # Show only still on the hub models
122
+ filtered_df = df[df[AutoEvalColumn.still_on_hub.name] == True]
123
+
124
+ type_emoji = [t[0] for t in type_query]
125
+ filtered_df = filtered_df.loc[df[AutoEvalColumn.model_type_symbol.name].isin(type_emoji)]
126
+ filtered_df = filtered_df.loc[df[AutoEvalColumn.precision.name].isin(precision_query + ["None"])]
127
+
128
+ numeric_interval = pd.IntervalIndex(sorted([NUMERIC_INTERVALS[s] for s in size_query]))
129
+ params_column = pd.to_numeric(df[AutoEvalColumn.params.name], errors="coerce")
130
+ mask = params_column.apply(lambda x: any(numeric_interval.contains(x)))
131
+ filtered_df = filtered_df.loc[mask]
132
+
133
+ return filtered_df
134
+
135
  # def filter_models(
136
  # df: pd.DataFrame, type_query: list, size_query: list, precision_query: list, show_deleted: bool, italian_only: bool
137
  # ) -> pd.DataFrame:
138
  # # Show all models
139
  # if show_deleted:
140
+ # filtered_df = df.copy()
141
  # else: # Show only still on the hub models
142
+ # filtered_df = df[df[AutoEvalColumn.still_on_hub.name] == True].copy()
143
+
144
+ # filtered_df[AutoEvalColumn.model.name] = filtered_df[AutoEvalColumn.model.name].apply(lambda x: x.split('>')[-2].split('<')[0] if '<a' in x else x)
145
 
146
  # type_emoji = [t[0] for t in type_query]
147
+ # filtered_df = filtered_df[filtered_df[AutoEvalColumn.model_type_symbol.name].isin(type_emoji)]
148
+ # filtered_df = filtered_df[filtered_df[AutoEvalColumn.precision.name].isin(precision_query + ["None"])]
149
 
150
  # numeric_interval = pd.IntervalIndex(sorted([NUMERIC_INTERVALS[s] for s in size_query]))
151
+ # params_column = pd.to_numeric(filtered_df[AutoEvalColumn.params.name], errors="coerce")
152
  # mask = params_column.apply(lambda x: any(numeric_interval.contains(x)))
153
+ # filtered_df = filtered_df[mask]
154
+
155
  # if italian_only:
156
  # filtered_df = filtered_df[filtered_df[AutoEvalColumn.author.name] == "๐Ÿ‡ฎ๐Ÿ‡น"]
157
 
158
  # return filtered_df
159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  def get_data_totale():
161
  dataset = pd.read_csv("mmlu_pro_it.csv", sep=',')
162
  if 'model ' in dataset.columns: