Files
Kohya-ss-sd-scripts/library/device_utils.py
2024-01-23 14:28:50 +02:00

10 lines
130 B
Python

import gc
import torch
def clean_memory():
if torch.cuda.is_available():
torch.cuda.empty_cache()
gc.collect()