m7mdal7aj commited on
Commit
0675d16
1 Parent(s): 24fe4cb

Update my_model/state_manager.py

Browse files
Files changed (1) hide show
  1. my_model/state_manager.py +4 -1
my_model/state_manager.py CHANGED
@@ -240,7 +240,10 @@ class StateManager:
240
  Returns:
241
  bool: True if the model is loaded, False otherwise.
242
  """
243
- return 'kbvqa' in st.session_state and st.session_state['kbvqa'] is not None and st.session_state.kbvqa.all_models_loaded
 
 
 
244
 
245
 
246
  def reload_detection_model(self) -> None:
 
240
  Returns:
241
  bool: True if the model is loaded, False otherwise.
242
  """
243
+ return 'kbvqa' in st.session_state and st.session_state['kbvqa'] is not None and \
244
+ st.session_state.kbvqa.all_models_loaded \
245
+ and (st.session_state['previous_state']['method'] is not None
246
+ and st.session_state['method'] == st.session_state['previous_state']['method'])
247
 
248
 
249
  def reload_detection_model(self) -> None: