zhuohan-7 commited on
Commit
1b7db5c
·
verified ·
1 Parent(s): 92846d4

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app/draw_diagram.py +4 -2
app/draw_diagram.py CHANGED
@@ -92,7 +92,7 @@ def draw(folder_name, category_one, category_two, sort, num_sort, model_size_ran
92
  data_columns = [i for i in chart_data.columns if i not in ['Model', 'model_show']]
93
 
94
  '''
95
- Show table
96
  '''
97
  with st.container():
98
  st.markdown('##### TABLE')
@@ -103,6 +103,9 @@ def draw(folder_name, category_one, category_two, sort, num_sort, model_size_ran
103
 
104
  chart_data_table = chart_data[['model_show', 'model_link'] + data_columns]
105
 
 
 
 
106
  chart_data_table = chart_data_table.sort_values(
107
  by=chart_data_table.columns[2],
108
  ascending=False
@@ -128,7 +131,6 @@ def draw(folder_name, category_one, category_two, sort, num_sort, model_size_ran
128
 
129
 
130
  # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
131
-
132
  # Initialize a session state variable for toggling the chart visibility
133
  if "show_chart" not in st.session_state:
134
  st.session_state.show_chart = False
 
92
  data_columns = [i for i in chart_data.columns if i not in ['Model', 'model_show']]
93
 
94
  '''
95
+ Show Table
96
  '''
97
  with st.container():
98
  st.markdown('##### TABLE')
 
103
 
104
  chart_data_table = chart_data[['model_show', 'model_link'] + data_columns]
105
 
106
+ # Format numeric columns to 2 decimal places
107
+ chart_data_table[chart_data_table.columns[2]] = chart_data_table[chart_data_table.columns[2]].apply(lambda x: f"{x:.3f}" if isinstance(x, (int, float)) else x)
108
+
109
  chart_data_table = chart_data_table.sort_values(
110
  by=chart_data_table.columns[2],
111
  ascending=False
 
131
 
132
 
133
  # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
 
134
  # Initialize a session state variable for toggling the chart visibility
135
  if "show_chart" not in st.session_state:
136
  st.session_state.show_chart = False