Upload handler.py
Browse files- handler.py +2 -2
handler.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import os
|
| 2 |
-
from typing import Any, Dict,
|
| 3 |
from PIL import Image
|
| 4 |
import torch
|
| 5 |
from diffusers import FluxPipeline
|
|
@@ -48,7 +48,7 @@ class EndpointHandler:
|
|
| 48 |
time_taken = end_time - start_time
|
| 49 |
print(f"Time taken: {time_taken:.2f} seconds")
|
| 50 |
|
| 51 |
-
def __call__(self, data: Dict[str, Any]) ->
|
| 52 |
try:
|
| 53 |
logger.info(f"Received incoming request with {data=}")
|
| 54 |
|
|
|
|
| 1 |
import os
|
| 2 |
+
from typing import Any, Dict, Union
|
| 3 |
from PIL import Image
|
| 4 |
import torch
|
| 5 |
from diffusers import FluxPipeline
|
|
|
|
| 48 |
time_taken = end_time - start_time
|
| 49 |
print(f"Time taken: {time_taken:.2f} seconds")
|
| 50 |
|
| 51 |
+
def __call__(self, data: Dict[str, Any]) -> Union[Image.Image, None]:
|
| 52 |
try:
|
| 53 |
logger.info(f"Received incoming request with {data=}")
|
| 54 |
|