Update pipeline.py
Browse files- pipeline.py +3 -3
pipeline.py
CHANGED
@@ -3,18 +3,18 @@ from typing import Any, Dict, List
|
|
3 |
|
4 |
import tensorflow as tf
|
5 |
from tensorflow import keras
|
6 |
-
from huggingface_hub import from_pretrained_keras, hf_hub_download
|
7 |
import base64
|
8 |
import io
|
|
|
9 |
import numpy as np
|
10 |
from PIL import Image
|
11 |
|
12 |
|
13 |
|
14 |
class PreTrainedPipeline():
|
15 |
-
def __init__(self,
|
16 |
|
17 |
-
self.model = keras.models.load_model("
|
18 |
|
19 |
def __call__(self, inputs: "Image.Image")-> List[Dict[str, Any]]:
|
20 |
|
|
|
3 |
|
4 |
import tensorflow as tf
|
5 |
from tensorflow import keras
|
|
|
6 |
import base64
|
7 |
import io
|
8 |
+
import os
|
9 |
import numpy as np
|
10 |
from PIL import Image
|
11 |
|
12 |
|
13 |
|
14 |
class PreTrainedPipeline():
|
15 |
+
def __init__(self, path: str):
|
16 |
|
17 |
+
self.model = keras.models.load_model(os.path.join(path, "tf_model.h5"))
|
18 |
|
19 |
def __call__(self, inputs: "Image.Image")-> List[Dict[str, Any]]:
|
20 |
|