Update handler.py
Browse files- handler.py +3 -4
handler.py
CHANGED
@@ -7,10 +7,9 @@ from diffusers.image_processor import VaeImageProcessor
|
|
7 |
|
8 |
class EndpointHandler:
|
9 |
def __init__(self, path=""):
|
10 |
-
|
11 |
-
self.
|
12 |
-
self.
|
13 |
-
self.vae = AutoencoderKL.from_pretrained(path, **kwargs).to(self.device).eval()
|
14 |
|
15 |
self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1)
|
16 |
self.image_processor = VaeImageProcessor(vae_scale_factor=self.vae_scale_factor)
|
|
|
7 |
|
8 |
class EndpointHandler:
|
9 |
def __init__(self, path=""):
|
10 |
+
self.device = "cuda"
|
11 |
+
self.dtype = torch.float16
|
12 |
+
self.vae = AutoencoderKL.from_pretrained(path, torch_dtype=self.dtype).to(self.device, self.dtype).eval()
|
|
|
13 |
|
14 |
self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1)
|
15 |
self.image_processor = VaeImageProcessor(vae_scale_factor=self.vae_scale_factor)
|