Update my_model/tabs/run_inference.py
Browse files
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"
|
107 |
-
|
108 |
-
|
|
|
|
|
|
|
109 |
else:
|
110 |
state_manager.reload_detection_model()
|
111 |
-
st.
|
112 |
-
|
|
|
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.')
|