Corey Morris commited on
Commit
8474e43
1 Parent(s): 0a33874

Added filter for parameter count. Fixed model filter so that it only filters on the Model name (index of the table)

Browse files
Files changed (1) hide show
  1. app.py +15 -9
app.py CHANGED
@@ -83,23 +83,29 @@ if filters:
83
  # Get the filtered data
84
  filtered_data = data_provider.get_data(selected_models)
85
 
 
 
86
 
 
 
 
 
 
 
 
87
 
 
 
 
88
 
89
- # sort the table by the MMLU_average column
90
- filtered_data = filtered_data.sort_values(by=['MMLU_average'], ascending=False)
91
 
92
  # Search box
93
  search_query = st.text_input("Filter by Model Name:", "")
94
 
95
- # Filter the DataFrame based on the search query, including the index
96
  if search_query:
97
- filtered_data = filtered_data[
98
- filtered_data.apply(
99
- lambda row: row.astype(str).str.contains(search_query, case=False).any() or search_query.lower() in row.name.lower(),
100
- axis=1
101
- )
102
- ]
103
 
104
  # Search box for columns
105
  column_search_query = st.text_input("Filter by Column/Task Name:", "")
 
83
  # Get the filtered data
84
  filtered_data = data_provider.get_data(selected_models)
85
 
86
+ # sort the table by the MMLU_average column
87
+ filtered_data = filtered_data.sort_values(by=['MMLU_average'], ascending=False)
88
 
89
+ # Select box for filtering by Parameters
90
+ parameter_threshold = st.selectbox(
91
+ 'Filter by Parameters (Less Than or Equal To):',
92
+ options=[3, 7, 13, 35, 'No threshold'],
93
+ index=4, # Set the default selected option to 'No threshold'
94
+ format_func=lambda x: f"{x}" if isinstance(x, int) else x
95
+ )
96
 
97
+ # Filter the DataFrame based on the selected parameter threshold if not 'No threshold'
98
+ if isinstance(parameter_threshold, int):
99
+ filtered_data = filtered_data[filtered_data['Parameters'] <= parameter_threshold]
100
 
 
 
101
 
102
  # Search box
103
  search_query = st.text_input("Filter by Model Name:", "")
104
 
105
+ # Filter the DataFrame based on the search query in the index (model name)
106
  if search_query:
107
+ filtered_data = filtered_data[filtered_data.index.str.contains(search_query, case=False)]
108
+
 
 
 
 
109
 
110
  # Search box for columns
111
  column_search_query = st.text_input("Filter by Column/Task Name:", "")