Spaces:
Running
on
Zero
Running
on
Zero
force gpu usage for Accelerator according to its init attributes
Browse files- gradio_ui.py +2 -1
gradio_ui.py
CHANGED
|
@@ -199,7 +199,8 @@ def process_image(image_path: str,
|
|
| 199 |
# Accelerator Setting
|
| 200 |
accelerator = Accelerator(
|
| 201 |
mixed_precision=mixed_precision,
|
| 202 |
-
|
|
|
|
| 203 |
|
| 204 |
weight_dtype = torch.float32
|
| 205 |
if accelerator.mixed_precision == "fp16":
|
|
|
|
| 199 |
# Accelerator Setting
|
| 200 |
accelerator = Accelerator(
|
| 201 |
mixed_precision=mixed_precision,
|
| 202 |
+
cpu=False
|
| 203 |
+
)
|
| 204 |
|
| 205 |
weight_dtype = torch.float32
|
| 206 |
if accelerator.mixed_precision == "fp16":
|