rockerritesh commited on
Commit
5a6c7d5
·
verified ·
1 Parent(s): 0c504eb

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -0
main.py CHANGED
@@ -118,6 +118,9 @@ def clean_memory():
118
  gc.collect()
119
  if torch.cuda.is_available():
120
  torch.cuda.empty_cache()
 
 
 
121
  logger.info("Memory cleaned")
122
 
123
  def predict(image):
 
118
  gc.collect()
119
  if torch.cuda.is_available():
120
  torch.cuda.empty_cache()
121
+ # Clear GPU cache
122
+ torch.cuda.empty_cache()
123
+ logger.info(f"Memory allocated after clearing cache: {torch.cuda.memory_allocated()} bytes")
124
  logger.info("Memory cleaned")
125
 
126
  def predict(image):