Simple debug version
Browse files- pipeline.py +4 -2
pipeline.py
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
import json
|
2 |
from typing import Any, Dict, List
|
|
|
3 |
import tensorflow as tf
|
4 |
-
from tensorflow
|
5 |
import base64
|
6 |
import io
|
7 |
import os
|
@@ -19,7 +20,8 @@ from PIL import Image
|
|
19 |
class PreTrainedPipeline():
|
20 |
def __init__(self, path: str):
|
21 |
# load the model
|
22 |
-
|
|
|
23 |
|
24 |
def __call__(self, inputs: "Image.Image")-> List[Dict[str, Any]]:
|
25 |
|
|
|
1 |
import json
|
2 |
from typing import Any, Dict, List
|
3 |
+
|
4 |
import tensorflow as tf
|
5 |
+
from tensorflow import keras
|
6 |
import base64
|
7 |
import io
|
8 |
import os
|
|
|
20 |
class PreTrainedPipeline():
|
21 |
def __init__(self, path: str):
|
22 |
# load the model
|
23 |
+
self.model = keras.models.load_model(os.path.join(path, "tf_model.h5"))
|
24 |
+
#self.model = tf.saved_model.load(os.path.join(path, "saved_model"))
|
25 |
|
26 |
def __call__(self, inputs: "Image.Image")-> List[Dict[str, Any]]:
|
27 |
|