enesbol commited on
Commit
5300450
·
1 Parent(s): f2f0518

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +3 -2
handler.py CHANGED
@@ -13,8 +13,9 @@ class EndpointHandler():
13
 
14
  def __init__(self, path=""):
15
  model_id = "timbrooks/instruct-pix2pix"
16
- self.model = StableDiffusionInstructPix2PixPipeline.from_pretrained(path, torch_dtype=torch.float16, safety_checker=None).to("cuda")
17
- self.model.scheduler = EulerAncestralDiscreteScheduler.from_config(self.model.scheduler.config)
 
18
 
19
  def __call__(self, data):
20
 
 
13
 
14
  def __init__(self, path=""):
15
  model_id = "timbrooks/instruct-pix2pix"
16
+ self.pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(model_id, torch_dtype=torch.float16, safety_checker=None)
17
+ self.pipe.to("cuda")
18
+ self.pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(self.pipe.scheduler.config)
19
 
20
  def __call__(self, data):
21