m7mdal7aj commited on
Commit
31229df
1 Parent(s): a55a660

Update my_model/utilities.py

Browse files
Files changed (1) hide show
  1. my_model/utilities.py +7 -8
my_model/utilities.py CHANGED
@@ -298,14 +298,13 @@ def free_gpu_resources():
298
  """
299
  try:
300
  if torch.cuda.is_available():
301
- torch.cuda.empty_cache()
302
- gc.collect()
303
- torch.cuda.empty_cache()
304
- gc.collect()
305
-
306
- st.write("GPU memory has been cleared.")
307
- except Exception as e:
308
- st.write(f"Error occurred while clearing GPU memory")
309
 
310
 
311
 
 
298
  """
299
  try:
300
  if torch.cuda.is_available():
301
+ torch.cuda.empty_cache()
302
+ torch.cuda.empty_cache()
303
+ gc.collect()
304
+ gc.collect()
305
+
306
+ st.write("GPU memory has been cleared.")
307
+
 
308
 
309
 
310