From 8fb9c57ed62dcef721d50c1eeb9c20f65c509215 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Sun, 11 Sep 2022 23:24:24 +0300 Subject: add half() supporrt for CLIP interrogation --- modules/devices.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'modules/devices.py') diff --git a/modules/devices.py b/modules/devices.py index 30d30b99..f88e807e 100644 --- a/modules/devices.py +++ b/modules/devices.py @@ -14,3 +14,9 @@ def get_optimal_device(): return torch.device("mps") return cpu + + +def torch_gc(): + if torch.cuda.is_available(): + torch.cuda.empty_cache() + torch.cuda.ipc_collect() -- cgit v1.2.1