add custom handler
Browse files- __pycache__/handler.cpython-38.pyc +0 -0
- handler.py +1 -3
__pycache__/handler.cpython-38.pyc
CHANGED
|
Binary files a/__pycache__/handler.cpython-38.pyc and b/__pycache__/handler.cpython-38.pyc differ
|
|
|
handler.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
from typing import Dict, List, Any
|
| 2 |
|
| 3 |
import base64
|
| 4 |
-
import logging
|
| 5 |
import numpy as np
|
| 6 |
import tensorflow as tf
|
| 7 |
from tensorflow import keras
|
|
@@ -23,7 +22,6 @@ class EndpointHandler():
|
|
| 23 |
|
| 24 |
def __call__(self, data: Dict[str, Any]) -> str:
|
| 25 |
# get inputs
|
| 26 |
-
logging.warning(data)
|
| 27 |
latent = data.pop("inputs", data)
|
| 28 |
batch_size = data.pop("batch_size", 1)
|
| 29 |
|
|
@@ -38,4 +36,4 @@ class EndpointHandler():
|
|
| 38 |
images_b64 = base64.b64encode(images.tobytes())
|
| 39 |
images_b64str = images_b64.decode()
|
| 40 |
|
| 41 |
-
return images_b64str
|
|
|
|
| 1 |
from typing import Dict, List, Any
|
| 2 |
|
| 3 |
import base64
|
|
|
|
| 4 |
import numpy as np
|
| 5 |
import tensorflow as tf
|
| 6 |
from tensorflow import keras
|
|
|
|
| 22 |
|
| 23 |
def __call__(self, data: Dict[str, Any]) -> str:
|
| 24 |
# get inputs
|
|
|
|
| 25 |
latent = data.pop("inputs", data)
|
| 26 |
batch_size = data.pop("batch_size", 1)
|
| 27 |
|
|
|
|
| 36 |
images_b64 = base64.b64encode(images.tobytes())
|
| 37 |
images_b64str = images_b64.decode()
|
| 38 |
|
| 39 |
+
return images_b64str
|