Update my_model/tabs/run_inference.py
Browse files- my_model/tabs/run_inference.py +22 -20
my_model/tabs/run_inference.py
CHANGED
@@ -82,26 +82,28 @@ class InferenceRunner(StateManager):
|
|
82 |
|
83 |
|
84 |
st.session_state.button_label = "Reload Model" if self.is_model_loaded() and self.settings_changed else "Load Model"
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
self.
|
|
|
|
|
|
|
|
|
|
|
94 |
else:
|
95 |
free_gpu_resources()
|
96 |
-
self.
|
97 |
-
|
|
|
|
|
|
|
98 |
free_gpu_resources()
|
99 |
-
self.
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
if self.is_model_loaded() and st.session_state.kbvqa.all_models_loaded:
|
104 |
-
free_gpu_resources()
|
105 |
-
self.image_qa_app(self.get_model())
|
106 |
-
else:
|
107 |
-
self.col1.warning(f'Model using {st.session_state.method} is not deployed yet, will be ready later.')
|
|
|
82 |
|
83 |
|
84 |
st.session_state.button_label = "Reload Model" if self.is_model_loaded() and self.settings_changed else "Load Model"
|
85 |
+
|
86 |
+
with self.col1:
|
87 |
+
if st.session_state.method == "Fine-Tuned Model":
|
88 |
+
|
89 |
+
with st.container():
|
90 |
+
nested_col11, nested_col12 = st.columns([0.5, 0.5])
|
91 |
+
if nested_col11.button(st.session_state.button_label):
|
92 |
+
if st.session_state.button_label == "Load Model":
|
93 |
+
if self.is_model_loaded():
|
94 |
+
free_gpu_resources()
|
95 |
+
self.col1.text("Model already loaded and no settings were changed:)")
|
96 |
+
else:
|
97 |
+
free_gpu_resources()
|
98 |
+
self.load_model()
|
99 |
else:
|
100 |
free_gpu_resources()
|
101 |
+
self.reload_detection_model()
|
102 |
+
if nested_col12.button("Force Reload"):
|
103 |
+
self.force_reload_model()
|
104 |
+
|
105 |
+
if self.is_model_loaded() and st.session_state.kbvqa.all_models_loaded:
|
106 |
free_gpu_resources()
|
107 |
+
self.image_qa_app(self.get_model())
|
108 |
+
else:
|
109 |
+
self.col1.warning(f'Model using {st.session_state.method} is not deployed yet, will be ready later.')
|
|
|
|
|
|
|
|
|
|
|
|