Spaces:
Running
on
Zero
Running
on
Zero
update
Browse files- binoculars/detector.py +0 -8
binoculars/detector.py
CHANGED
@@ -85,14 +85,6 @@ class Binoculars(object):
|
|
85 |
raise ValueError(f"Invalid mode: {mode}")
|
86 |
|
87 |
def free_memory(self) -> None:
|
88 |
-
"""Explicitly free GPU memory by moving models to CPU and deleting them"""
|
89 |
-
print("Freeing model memory...")
|
90 |
-
if hasattr(self, 'observer_model') and self.observer_model is not None:
|
91 |
-
self.observer_model = self.observer_model.to('cpu')
|
92 |
-
|
93 |
-
if hasattr(self, 'performer_model') and self.performer_model is not None:
|
94 |
-
self.performer_model = self.performer_model.to('cpu')
|
95 |
-
|
96 |
if torch.cuda.is_available():
|
97 |
torch.cuda.empty_cache()
|
98 |
torch.cuda.synchronize()
|
|
|
85 |
raise ValueError(f"Invalid mode: {mode}")
|
86 |
|
87 |
def free_memory(self) -> None:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
if torch.cuda.is_available():
|
89 |
torch.cuda.empty_cache()
|
90 |
torch.cuda.synchronize()
|