Corey Morris
commited on
Commit
·
3abc48f
1
Parent(s):
cb21769
Added search for Model name and Task name
Browse files
app.py
CHANGED
|
@@ -84,7 +84,28 @@ filtered_data = data_provider.get_data(selected_models)
|
|
| 84 |
|
| 85 |
# sort the table by the MMLU_average column
|
| 86 |
filtered_data = filtered_data.sort_values(by=['MMLU_average'], ascending=False)
|
| 87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
# CSV download
|
| 90 |
|
|
|
|
| 84 |
|
| 85 |
# sort the table by the MMLU_average column
|
| 86 |
filtered_data = filtered_data.sort_values(by=['MMLU_average'], ascending=False)
|
| 87 |
+
|
| 88 |
+
# Search box
|
| 89 |
+
search_query = st.text_input("Filter by Model Name:", "")
|
| 90 |
+
|
| 91 |
+
# Filter the DataFrame based on the search query, including the index
|
| 92 |
+
if search_query:
|
| 93 |
+
filtered_data = filtered_data[
|
| 94 |
+
filtered_data.apply(
|
| 95 |
+
lambda row: row.astype(str).str.contains(search_query, case=False).any() or search_query.lower() in row.name.lower(),
|
| 96 |
+
axis=1
|
| 97 |
+
)
|
| 98 |
+
]
|
| 99 |
+
|
| 100 |
+
# Search box for columns
|
| 101 |
+
column_search_query = st.text_input("Filter by Column/Task Name:", "")
|
| 102 |
+
|
| 103 |
+
# Get the columns that contain the search query
|
| 104 |
+
matching_columns = [col for col in filtered_data.columns if column_search_query.lower() in col.lower()]
|
| 105 |
+
|
| 106 |
+
# Display the DataFrame with only the matching columns
|
| 107 |
+
st.dataframe(filtered_data[matching_columns])
|
| 108 |
+
|
| 109 |
|
| 110 |
# CSV download
|
| 111 |
|