Upload handler.py
Browse files- handler.py +2 -2
handler.py
CHANGED
|
@@ -2,7 +2,7 @@ import os
|
|
| 2 |
from typing import Any, Dict
|
| 3 |
|
| 4 |
from diffusers import FluxPipeline, FluxTransformer2DModel, AutoencoderKL, TorchAoConfig
|
| 5 |
-
from PIL
|
| 6 |
import torch
|
| 7 |
|
| 8 |
#import torch._dynamo
|
|
@@ -30,7 +30,7 @@ class EndpointHandler:
|
|
| 30 |
self.pipeline.to("cuda")
|
| 31 |
|
| 32 |
#@torch.inference_mode()
|
| 33 |
-
def __call__(self, data: Dict[str, Any]) -> Image:
|
| 34 |
#logger.info(f"Received incoming request with {data=}")
|
| 35 |
|
| 36 |
if "inputs" in data and isinstance(data["inputs"], str):
|
|
|
|
| 2 |
from typing import Any, Dict
|
| 3 |
|
| 4 |
from diffusers import FluxPipeline, FluxTransformer2DModel, AutoencoderKL, TorchAoConfig
|
| 5 |
+
from PIL import Image
|
| 6 |
import torch
|
| 7 |
|
| 8 |
#import torch._dynamo
|
|
|
|
| 30 |
self.pipeline.to("cuda")
|
| 31 |
|
| 32 |
#@torch.inference_mode()
|
| 33 |
+
def __call__(self, data: Dict[str, Any]) -> Image.Image:
|
| 34 |
#logger.info(f"Received incoming request with {data=}")
|
| 35 |
|
| 36 |
if "inputs" in data and isinstance(data["inputs"], str):
|