Update my_model/tabs/run_inference.py
Browse files
my_model/tabs/run_inference.py
CHANGED
@@ -84,13 +84,17 @@ class InferenceRunner(StateManager):
|
|
84 |
if self.col1.button(st.session_state.button_label):
|
85 |
if st.session_state.button_label == "Load Model":
|
86 |
if self.is_model_loaded():
|
|
|
87 |
self.col1.text("Model already loaded and no settings were changed:)")
|
88 |
-
else:
|
|
|
89 |
self.load_model()
|
90 |
else:
|
|
|
91 |
self.reload_detection_model()
|
92 |
|
93 |
if self.is_model_loaded() and st.session_state.kbvqa.all_models_loaded:
|
|
|
94 |
self.image_qa_app(self.get_model())
|
95 |
else:
|
96 |
self.col1.warning(f'Model using {st.session_state.method} is not deployed yet, will be ready later.')
|
|
|
84 |
if self.col1.button(st.session_state.button_label):
|
85 |
if st.session_state.button_label == "Load Model":
|
86 |
if self.is_model_loaded():
|
87 |
+
free_gpu_resources()
|
88 |
self.col1.text("Model already loaded and no settings were changed:)")
|
89 |
+
else:
|
90 |
+
free_gpu_resources()
|
91 |
self.load_model()
|
92 |
else:
|
93 |
+
free_gpu_resources()
|
94 |
self.reload_detection_model()
|
95 |
|
96 |
if self.is_model_loaded() and st.session_state.kbvqa.all_models_loaded:
|
97 |
+
free_gpu_resources()
|
98 |
self.image_qa_app(self.get_model())
|
99 |
else:
|
100 |
self.col1.warning(f'Model using {st.session_state.method} is not deployed yet, will be ready later.')
|