saherPervaiz commited on
Commit
5d2751f
·
verified ·
1 Parent(s): a536b1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -1
app.py CHANGED
@@ -217,4 +217,20 @@ if uploaded_file is not None:
217
  table_data = metrics_df.values
218
  table_columns = metrics_df.columns.tolist()
219
 
220
- table = ax.table(cellText=table_data, colLabels=table_columns, loc='center', cellLoc='center',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
  table_data = metrics_df.values
218
  table_columns = metrics_df.columns.tolist()
219
 
220
+ table = ax.table(cellText=table_data, colLabels=table_columns, loc='center', cellLoc='center', colLoc='center')
221
+ table.auto_set_font_size(False)
222
+ table.set_fontsize(10)
223
+ table.scale(1.2, 1.2) # Adjust the scale for better appearance
224
+
225
+ # Save the table as a PNG file
226
+ png_file = "model_report.png"
227
+ fig.savefig(png_file, bbox_inches='tight', dpi=300)
228
+
229
+ # Provide a download button for the PNG file
230
+ with open(png_file, "rb") as file:
231
+ st.download_button(
232
+ label="Download as PNG",
233
+ data=file,
234
+ file_name="model_report.png",
235
+ mime="image/png"
236
+ )