Update handler.py
Browse files- handler.py +0 -8
handler.py
CHANGED
@@ -8,14 +8,6 @@ from diffusers.image_processor import VaeImageProcessor
|
|
8 |
class EndpointHandler:
|
9 |
def __init__(self, path=""):
|
10 |
kwargs = {"torch_dtype": torch.float16}
|
11 |
-
model_data = model_info(path)
|
12 |
-
has_model_index = any(
|
13 |
-
file.rfilename == "model_index.json" for file in model_data.siblings
|
14 |
-
)
|
15 |
-
|
16 |
-
if has_model_index:
|
17 |
-
kwargs["subfolder"] = "vae"
|
18 |
-
|
19 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
20 |
self.dtype = kwargs["torch_dtype"]
|
21 |
self.vae = AutoencoderKL.from_pretrained(path, **kwargs).to(self.device).eval()
|
|
|
8 |
class EndpointHandler:
|
9 |
def __init__(self, path=""):
|
10 |
kwargs = {"torch_dtype": torch.float16}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
12 |
self.dtype = kwargs["torch_dtype"]
|
13 |
self.vae = AutoencoderKL.from_pretrained(path, **kwargs).to(self.device).eval()
|