Spaces:
Running
Running
Update handler.py
Browse files- handler.py +1 -0
handler.py
CHANGED
@@ -11,6 +11,7 @@ class EndpointHandler():
|
|
11 |
def __init__(self, path=""):
|
12 |
model_id = "timbrooks/instruct-pix2pix"
|
13 |
self.pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(model_id, torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32, safety_checker=None)
|
|
|
14 |
self.pipe.to(device)
|
15 |
self.pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(self.pipe.scheduler.config)
|
16 |
|
|
|
11 |
def __init__(self, path=""):
|
12 |
model_id = "timbrooks/instruct-pix2pix"
|
13 |
self.pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(model_id, torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32, safety_checker=None)
|
14 |
+
pipe.to("cuda")
|
15 |
self.pipe.to(device)
|
16 |
self.pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(self.pipe.scheduler.config)
|
17 |
|