Update handler.py
Browse files- handler.py +9 -0
handler.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
from typing import Dict, List, Any
|
| 2 |
import base64
|
| 3 |
|
|
|
|
|
|
|
| 4 |
import tensorflow as tf
|
| 5 |
from tensorflow import keras
|
| 6 |
from keras_cv.models.generative.stable_diffusion.text_encoder import TextEncoder
|
|
@@ -73,4 +75,11 @@ class EndpointHandler():
|
|
| 73 |
unconditional_context_b64 = base64.b64encode(unconditional_context.numpy().tobytes())
|
| 74 |
unconditional_context_b64str = unconditional_context_b64.decode()
|
| 75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
return {"context_b64str": context_b64str, "unconditional_context_b64str": unconditional_context_b64str}
|
|
|
|
| 1 |
from typing import Dict, List, Any
|
| 2 |
import base64
|
| 3 |
|
| 4 |
+
import logging
|
| 5 |
+
|
| 6 |
import tensorflow as tf
|
| 7 |
from tensorflow import keras
|
| 8 |
from keras_cv.models.generative.stable_diffusion.text_encoder import TextEncoder
|
|
|
|
| 75 |
unconditional_context_b64 = base64.b64encode(unconditional_context.numpy().tobytes())
|
| 76 |
unconditional_context_b64str = unconditional_context_b64.decode()
|
| 77 |
|
| 78 |
+
print("1")
|
| 79 |
+
print(context_b64)
|
| 80 |
+
logging.info("2")
|
| 81 |
+
logging.info(context_b64)
|
| 82 |
+
logging.warning("3")
|
| 83 |
+
logging.warning(context_b64)
|
| 84 |
+
|
| 85 |
return {"context_b64str": context_b64str, "unconditional_context_b64str": unconditional_context_b64str}
|