m7mdal7aj commited on
Commit
a5c03d9
1 Parent(s): ade7363

Update my_model/state_manager.py

Browse files
Files changed (1) hide show
  1. my_model/state_manager.py +4 -4
my_model/state_manager.py CHANGED
@@ -55,7 +55,7 @@ class StateManager:
55
 
56
  show_model_settings = self.col3.checkbox("Show Model Settings", True, disabled=self.is_widget_disabled)
57
  if show_model_settings:
58
- self.display_model_settings()
59
 
60
 
61
 
@@ -96,7 +96,7 @@ class StateManager:
96
  """
97
  return self.has_state_changed()
98
 
99
-
100
  def display_model_settings(self):
101
  """
102
  Displays a table of current model settings in the third column.
@@ -104,9 +104,9 @@ class StateManager:
104
  """
105
  self.col3.write("##### Current Model Settings:")
106
  data = [{'Setting': key, 'Value': str(value)} for key, value in st.session_state.items() if key in ["confidence_level", 'detection_model', 'method', 'kbvqa', 'previous_state', 'settings_changed', 'loading_in_progress', 'model_loaded', 'time_taken_to_load_model' ]]
107
- df = pd.DataFrame(data)
108
  #styled_df = df.style.set_properties(**{'background-color': 'white', 'color': 'black', 'border-color': 'black'}).set_table_styles([{'selector': 'th','props': [('background-color', 'gray'), ('font-weight', 'bold')]}])
109
- self.col3.write(df)
110
 
111
 
112
  def display_session_state(self):
 
55
 
56
  show_model_settings = self.col3.checkbox("Show Model Settings", True, disabled=self.is_widget_disabled)
57
  if show_model_settings:
58
+ self.display_model_settings
59
 
60
 
61
 
 
96
  """
97
  return self.has_state_changed()
98
 
99
+ @property
100
  def display_model_settings(self):
101
  """
102
  Displays a table of current model settings in the third column.
 
104
  """
105
  self.col3.write("##### Current Model Settings:")
106
  data = [{'Setting': key, 'Value': str(value)} for key, value in st.session_state.items() if key in ["confidence_level", 'detection_model', 'method', 'kbvqa', 'previous_state', 'settings_changed', 'loading_in_progress', 'model_loaded', 'time_taken_to_load_model' ]]
107
+ df = pd.DataFrame(data).reset_index(drop=True)
108
  #styled_df = df.style.set_properties(**{'background-color': 'white', 'color': 'black', 'border-color': 'black'}).set_table_styles([{'selector': 'th','props': [('background-color', 'gray'), ('font-weight', 'bold')]}])
109
+ return self.col3.write(df)
110
 
111
 
112
  def display_session_state(self):