English
John6666 commited on
Commit
d564159
·
verified ·
1 Parent(s): 264a49a

Upload handler.py

Browse files
Files changed (1) hide show
  1. handler.py +2 -2
handler.py CHANGED
@@ -1,5 +1,5 @@
1
  import os
2
- from typing import Any, Dict, Tuple
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]) -> Tuple[Image.Image, None]:
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