Commit f7388a80 authored by dengjb's avatar dengjb
Browse files

Update utils.py

parent df2d8442
......@@ -12,11 +12,8 @@ _VAE_SIZE_THRESHOLD_ = 300000000 # vae should not be smaller than this
_MODEL_SIZE_THRESHOLD_ = 3000000000 # model should not be smaller than this
def compute_gpu_memory():
import pynvml
pynvml.nvmlInit()
handle = pynvml.nvmlDeviceGetHandleByIndex(0)
meminfo = pynvml.nvmlDeviceGetMemoryInfo(handle)
return round(meminfo.total / 1024 / 1024 / 1024, 2)
return round(64, 2)
def empty_cache():
"""Empty CUDA cache. Essential in stable diffusion pipeline."""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment