m7mdal7aj commited on
Commit
7e798e5
1 Parent(s): 867e680

Update my_model/state_manager.py

Browse files
Files changed (1) hide show
  1. my_model/state_manager.py +8 -7
my_model/state_manager.py CHANGED
@@ -18,12 +18,12 @@ class StateManager:
18
  def initialize_state(self):
19
  if "previous_state" not in st.session_state:
20
  st.session_state['previous_state'] = {'method': None, 'detection_model': None, 'confidence_level': None}
21
- if 'method' not in st.session_state:
22
- st.session_state['method'] = "Fine-Tuned Model"
23
- if 'confidence_level' not in st.session_state:
24
- st.session_state['confidence_level'] = 0.4
25
- if 'detection_model' not in st.session_state:
26
- st.session_state['detection_model'] = 'detic'
27
  if 'images_data' not in st.session_state:
28
  st.session_state['images_data'] = {}
29
  if 'kbvqa' not in st.session_state:
@@ -198,7 +198,8 @@ class StateManager:
198
  for key in st.session_state['previous_state']:
199
  if key == 'confidence_level':
200
  continue # confidence_level tracker is separate
201
- if st.session_state[key] != st.session_state['previous_state'][key]:
 
202
  return True # Found a change
203
  else: return False # No changes found
204
 
 
18
  def initialize_state(self):
19
  if "previous_state" not in st.session_state:
20
  st.session_state['previous_state'] = {'method': None, 'detection_model': None, 'confidence_level': None}
21
+ #if 'method' not in st.session_state:
22
+ # st.session_state['method'] = "Fine-Tuned Model"
23
+ #if 'confidence_level' not in st.session_state:
24
+ # st.session_state['confidence_level'] = 0.4
25
+ #if 'detection_model' not in st.session_state:
26
+ # st.session_state['detection_model'] = 'detic'
27
  if 'images_data' not in st.session_state:
28
  st.session_state['images_data'] = {}
29
  if 'kbvqa' not in st.session_state:
 
198
  for key in st.session_state['previous_state']:
199
  if key == 'confidence_level':
200
  continue # confidence_level tracker is separate
201
+ if key in st.session_state and st.session_state[key] != st.session_state['previous_state'][key]:
202
+ st.write("change check", key)
203
  return True # Found a change
204
  else: return False # No changes found
205