m7mdal7aj commited on
Commit
055a9f2
1 Parent(s): 79bbec0

Update my_model/KBVQA.py

Browse files
Files changed (1) hide show
  1. my_model/KBVQA.py +0 -20
my_model/KBVQA.py CHANGED
@@ -167,24 +167,6 @@ class KBVQA:
167
  """
168
 
169
  return self.kbvqa_model is not None and self.captioner is not None and self.detector is not None
170
-
171
- def delete_model(self):
172
- """
173
- Forces a reload of all models, freeing up GPU resources. This method deletes the current models and calls `free_gpu_resources`.
174
- """
175
- st.write('UUUUUUU')
176
- free_gpu_resources()
177
- if self.kbvqa_model is not None:
178
- del self.kbvqa_model
179
- free_gpu_resources()
180
- if self.captioner is not None:
181
- del self.captioner
182
- free_gpu_resources()
183
- if self.detector is not None:
184
- del self.detector
185
- free_gpu_resources()
186
-
187
- free_gpu_resources()
188
 
189
 
190
 
@@ -274,8 +256,6 @@ def prepare_kbvqa_model(only_reload_detection_model: bool = False, force_reload:
274
  # Progress bar for model loading
275
 
276
  if force_reload:
277
- st.write('FFFFFFFFF')
278
- self.delete_model()
279
  loading_message = 'Force Reloading model.. this should take no more than a few minutes!'
280
  else: loading_message = 'Looading model.. this should take no more than a few minutes!'
281
 
 
167
  """
168
 
169
  return self.kbvqa_model is not None and self.captioner is not None and self.detector is not None
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
 
171
 
172
 
 
256
  # Progress bar for model loading
257
 
258
  if force_reload:
 
 
259
  loading_message = 'Force Reloading model.. this should take no more than a few minutes!'
260
  else: loading_message = 'Looading model.. this should take no more than a few minutes!'
261