m7mdal7aj commited on
Commit
a1bb21b
1 Parent(s): cd3678b

Update my_model/tabs/run_inference.py

Browse files
Files changed (1) hide show
  1. my_model/tabs/run_inference.py +9 -5
my_model/tabs/run_inference.py CHANGED
@@ -103,13 +103,17 @@ def run_inference():
103
  button_label = "Reload Model" if state_manager.is_model_loaded() and state_manager.has_state_changed() else "Load Model"
104
  if st.session_state.method == "Fine-Tuned Model":
105
  if st.button(button_label):
106
- if button_label == "Load Model" and state_manager.is_model_loaded():
107
- st.write("stop playing around :):)P:)")
108
- st.text("Model already loaded.")
 
 
 
109
  else:
110
  state_manager.reload_detection_model()
111
- st.write("Model is ready for inference.")
112
- if state_manager.is_model_loaded():
 
113
  image_qa_app(state_manager.get_model())
114
  else:
115
  st.write('Model is not ready yet, will be updated later.')
 
103
  button_label = "Reload Model" if state_manager.is_model_loaded() and state_manager.has_state_changed() else "Load Model"
104
  if st.session_state.method == "Fine-Tuned Model":
105
  if st.button(button_label):
106
+ if button_label == "Load Model":
107
+ if state_manager.is_model_loaded():
108
+ st.text("Model already loaded and no settings were changed:)")
109
+
110
+ else: state_manager.load_model()
111
+
112
  else:
113
  state_manager.reload_detection_model()
114
+ st.success("Model reloaded with updated settings and ready for inference.")
115
+
116
+ if state_manager.is_model_loaded() and st.session_state.kbvqa.all_models_loaded:
117
  image_qa_app(state_manager.get_model())
118
  else:
119
  st.write('Model is not ready yet, will be updated later.')