Spaces:
Runtime error
Runtime error
Ming Li
commited on
Commit
·
e557299
1
Parent(s):
3dd8e2c
turn off xformers
Browse files
model.py
CHANGED
|
@@ -57,8 +57,8 @@ class Model:
|
|
| 57 |
base_model_id, safety_checker=None, controlnet=controlnet, torch_dtype=torch.float16
|
| 58 |
)
|
| 59 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
| 60 |
-
|
| 61 |
-
|
| 62 |
pipe.to(self.device)
|
| 63 |
torch.cuda.empty_cache()
|
| 64 |
gc.collect()
|
|
|
|
| 57 |
base_model_id, safety_checker=None, controlnet=controlnet, torch_dtype=torch.float16
|
| 58 |
)
|
| 59 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
| 60 |
+
if self.device.type == "cuda":
|
| 61 |
+
pipe.disable_xformers_memory_efficient_attention()
|
| 62 |
pipe.to(self.device)
|
| 63 |
torch.cuda.empty_cache()
|
| 64 |
gc.collect()
|