Corey Morris commited on
Commit
a34a60b
1 Parent(s): c90b29a

Moved CSV download to just below the table

Browse files
Files changed (1) hide show
  1. app.py +10 -24
app.py CHANGED
@@ -87,7 +87,7 @@ if filters:
87
  default=selected_models
88
  )
89
 
90
- # Get the filtered data and display it in a table
91
  st.header('Sortable table')
92
  filtered_data = data_provider.get_data(selected_models)
93
 
@@ -95,7 +95,15 @@ filtered_data = data_provider.get_data(selected_models)
95
  filtered_data = filtered_data.sort_values(by=['MMLU_average'], ascending=False)
96
  st.dataframe(filtered_data[selected_columns])
97
 
98
- # The rest of your plotting code...
 
 
 
 
 
 
 
 
99
 
100
  def create_plot(df, arc_column, moral_column, models=None):
101
  if models is not None:
@@ -161,25 +169,3 @@ st.plotly_chart(fig)
161
 
162
  fig = px.histogram(filtered_data, x="MMLU_moral_disputes", marginal="rug", hover_data=filtered_data.columns)
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
-
 
87
  default=selected_models
88
  )
89
 
90
+ # Get the filtered data
91
  st.header('Sortable table')
92
  filtered_data = data_provider.get_data(selected_models)
93
 
 
95
  filtered_data = filtered_data.sort_values(by=['MMLU_average'], ascending=False)
96
  st.dataframe(filtered_data[selected_columns])
97
 
98
+ # CSV download
99
+ csv = filtered_data.to_csv(index=True)
100
+ st.download_button(
101
+ label="Download data as CSV",
102
+ data=csv,
103
+ file_name="model_evaluation_results.csv",
104
+ mime="text/csv",
105
+ )
106
+
107
 
108
  def create_plot(df, arc_column, moral_column, models=None):
109
  if models is not None:
 
169
 
170
  fig = px.histogram(filtered_data, x="MMLU_moral_disputes", marginal="rug", hover_data=filtered_data.columns)
171
  st.plotly_chart(fig)