Add CUDA
Browse files- handler.py +1 -1
handler.py
CHANGED
@@ -13,7 +13,7 @@ class EndpointHandler():
|
|
13 |
device = "cuda"
|
14 |
else:
|
15 |
device = "cpu"
|
16 |
-
self._pipe = AutoPipelineForImage2Image.from_pretrained(path, torch_dtype=torch.
|
17 |
|
18 |
def __call__(self, data: Dict[str, Any]) -> list[Dict[str, Any]]:
|
19 |
inputs = data.pop("inputs", data)
|
|
|
13 |
device = "cuda"
|
14 |
else:
|
15 |
device = "cpu"
|
16 |
+
self._pipe = AutoPipelineForImage2Image.from_pretrained(path, torch_dtype=torch.float16).to(device)
|
17 |
|
18 |
def __call__(self, data: Dict[str, Any]) -> list[Dict[str, Any]]:
|
19 |
inputs = data.pop("inputs", data)
|