Corey Morris commited on
Commit
c90b29a
·
1 Parent(s): 51a128e

Added download CSV button

Browse files
Files changed (1) hide show
  1. app.py +19 -6
app.py CHANGED
@@ -56,12 +56,6 @@ class MultiURLData:
56
  cols = cols[:2] + cols[-1:] + cols[2:-1]
57
  data = data[cols]
58
 
59
- # # move the MMLU_average column to the the second column in the dataframe
60
- # cols = data.columns.tolist()
61
- # cols = cols[:1] + cols[-1:] + cols[1:-1]
62
- # data = data[cols]
63
- # data
64
-
65
  return data
66
 
67
  # filter data based on the index
@@ -169,4 +163,23 @@ fig = px.histogram(filtered_data, x="MMLU_moral_disputes", marginal="rug", hover
169
  st.plotly_chart(fig)
170
 
171
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
 
 
56
  cols = cols[:2] + cols[-1:] + cols[2:-1]
57
  data = data[cols]
58
 
 
 
 
 
 
 
59
  return data
60
 
61
  # filter data based on the index
 
163
  st.plotly_chart(fig)
164
 
165
 
166
+ # download CSV
167
+
168
+ # Get the filtered data and display it in a table
169
+ st.header('Sortable table')
170
+ filtered_data = data_provider.get_data(selected_models)
171
+
172
+ # sort the table by the MMLU_average column
173
+ filtered_data = filtered_data.sort_values(by=['MMLU_average'], ascending=False)
174
+ st.dataframe(filtered_data[selected_columns])
175
+
176
+ csv = filtered_data.to_csv(index=True)
177
+ st.download_button(
178
+ label="Download data as CSV",
179
+ data=csv,
180
+ file_name="model_evaluation_results.csv",
181
+ mime="text/csv",
182
+ )
183
+
184
+ # The rest of your plotting code...
185