79559422

Date: 2025-04-07 08:45:58
Score: 0.5
Natty:
Report link

Better deleting all reference

import gc


del model

gc.collect()
torch.cuda.empty_cache()

# check memory
print(torch.cuda.memory_allocated())


del gen_nlp
del tokenizer_ctrl

gc.collect()
torch.cuda.empty_cache()

# check memory again
print(torch.cuda.memory_allocated())
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Jacky