m7mdal7aj commited on
Commit
16b6309
1 Parent(s): 5b25ca3

Update my_model/tabs/run_inference.py

Browse files
Files changed (1) hide show
  1. my_model/tabs/run_inference.py +7 -4
my_model/tabs/run_inference.py CHANGED
@@ -94,6 +94,11 @@ class InferenceRunner(StateManager):
94
  st.session_state.button_label = "Reload Model" if self.is_model_loaded() and self.settings_changed else "Load Model"
95
 
96
  with self.col1:
 
 
 
 
 
97
  if st.session_state.method == "Fine-Tuned Model":
98
 
99
  with st.container():
@@ -112,10 +117,6 @@ class InferenceRunner(StateManager):
112
 
113
  if nested_col12.button("Force Reload"):
114
  force_reload_full_model = True
115
-
116
- if self.is_model_loaded() and st.session_state.kbvqa.all_models_loaded:
117
- free_gpu_resources()
118
- self.image_qa_app(self.get_model())
119
 
120
  if load_fine_tuned_model:
121
  free_gpu_resources()
@@ -131,6 +132,8 @@ class InferenceRunner(StateManager):
131
  elif force_reload_full_model:
132
  free_gpu_resources()
133
  self.force_reload_model()
 
 
134
 
135
  elif st.session_state.method == "In-Context Learning (n-shots)":
136
  self.col1.warning(f'Model using {st.session_state.method} is not deployed yet, will be ready later.')
 
94
  st.session_state.button_label = "Reload Model" if self.is_model_loaded() and self.settings_changed else "Load Model"
95
 
96
  with self.col1:
97
+
98
+ if self.is_model_loaded():
99
+ free_gpu_resources()
100
+ self.image_qa_app(self.get_model())
101
+
102
  if st.session_state.method == "Fine-Tuned Model":
103
 
104
  with st.container():
 
117
 
118
  if nested_col12.button("Force Reload"):
119
  force_reload_full_model = True
 
 
 
 
120
 
121
  if load_fine_tuned_model:
122
  free_gpu_resources()
 
132
  elif force_reload_full_model:
133
  free_gpu_resources()
134
  self.force_reload_model()
135
+
136
+
137
 
138
  elif st.session_state.method == "In-Context Learning (n-shots)":
139
  self.col1.warning(f'Model using {st.session_state.method} is not deployed yet, will be ready later.')