Commit c77eba6 1 parent 87a30f1 commit c77eba6 Copy full SHA for c77eba6
File tree 11 files changed +3
-143
lines changed
huggingface_transformer/model
test_data/test_truss/model
11 files changed +3
-143
lines changed Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " truss"
3
- version = " 0.4.4 "
3
+ version = " 0.4.5 "
4
4
description = " A seamless bridge from model development to model delivery"
5
5
license = " MIT"
6
6
readme = " README.md"
Original file line number Diff line number Diff line change @@ -12,20 +12,6 @@ def load(self):
12
12
# Load model here and assign to self._model.
13
13
pass
14
14
15
- def preprocess (self , model_input : Any ) -> Any :
16
- """
17
- Incorporate pre-processing required by the model if desired here.
18
-
19
- These might be feature transformations that are tightly coupled to the model.
20
- """
21
- return model_input
22
-
23
- def postprocess (self , model_output : Any ) -> Any :
24
- """
25
- Incorporate post-processing required by the model if desired here.
26
- """
27
- return model_output
28
-
29
15
def predict (self , model_input : Any ) -> Any :
30
16
model_output = {}
31
17
# Invoke model on model_input and calculate predictions here.
Original file line number Diff line number Diff line change @@ -27,20 +27,6 @@ def load(self):
27
27
** transformer_config ,
28
28
)
29
29
30
- def preprocess (self , model_input : Any ) -> Any :
31
- """
32
- Incorporate pre-processing required by the model if desired here.
33
-
34
- These might be feature transformations that are tightly coupled to the model.
35
- """
36
- return model_input
37
-
38
- def postprocess (self , model_output : Any ) -> Any :
39
- """
40
- Incorporate post-processing required by the model if desired here.
41
- """
42
- return model_output
43
-
44
30
def predict (self , model_input : Any ) -> Any :
45
31
model_output = {}
46
32
instances = model_input
Original file line number Diff line number Diff line change @@ -17,20 +17,6 @@ def load(self):
17
17
str (self ._data_dir / self ._model_binary_dir )
18
18
)
19
19
20
- def preprocess (self , model_input : Any ) -> Any :
21
- """
22
- Incorporate pre-processing required by the model if desired here.
23
-
24
- These might be feature transformations that are tightly coupled to the model.
25
- """
26
- return model_input
27
-
28
- def postprocess (self , model_output : Any ) -> Any :
29
- """
30
- Incorporate post-processing required by the model if desired here.
31
- """
32
- return model_output
33
-
34
20
def predict (self , model_input : Any ) -> Any :
35
21
model_output = {}
36
22
inputs = np .array (model_input )
Original file line number Diff line number Diff line change @@ -25,20 +25,6 @@ def load(self):
25
25
model_file_path = next (path for path in paths if path .exists ())
26
26
self ._model = joblib .load (model_file_path )
27
27
28
- def preprocess (self , model_input : Any ) -> Any :
29
- """
30
- Incorporate pre-processing required by the model if desired here.
31
-
32
- These might be feature transformations that are tightly coupled to the model.
33
- """
34
- return model_input
35
-
36
- def postprocess (self , model_output : Any ) -> Any :
37
- """
38
- Incorporate post-processing required by the model if desired here.
39
- """
40
- return model_output
41
-
42
28
def predict (self , model_input : Any ) -> Any :
43
29
model_output = {}
44
30
result = self ._model .predict (model_input )
Original file line number Diff line number Diff line change @@ -16,20 +16,6 @@ def load(self):
16
16
model_binary_dir_path = self ._data_dir / self ._model_binary_dir
17
17
self ._model = mlflow .pyfunc .load_model (model_binary_dir_path / "model" )
18
18
19
- def preprocess (self , model_input : Any ) -> Any :
20
- """
21
- Incorporate pre-processing required by the model if desired here.
22
-
23
- These might be feature transformations that are tightly coupled to the model.
24
- """
25
- return model_input
26
-
27
- def postprocess (self , model_output : Any ) -> Any :
28
- """
29
- Incorporate post-processing required by the model if desired here.
30
- """
31
- return model_output
32
-
33
19
def predict (self , model_input : Any ) -> Any :
34
20
model_output = {}
35
21
inputs = np .array (model_input )
Original file line number Diff line number Diff line change @@ -12,19 +12,5 @@ def load(self):
12
12
with open (self ._data_dir / "pipeline.cpick" , "rb" ) as f :
13
13
self ._pipeline = pickle .load (f )
14
14
15
- def preprocess (self , model_input : Any ) -> Any :
16
- """
17
- Incorporate pre-processing required by the model if desired here.
18
-
19
- These might be feature transformations that are tightly coupled to the model.
20
- """
21
- return model_input
22
-
23
- def postprocess (self , model_output : Any ) -> Any :
24
- """
25
- Incorporate post-processing required by the model if desired here.
26
- """
27
- return model_output
28
-
29
15
def predict (self , model_input : Any ) -> Any :
30
16
return self ._pipeline (model_input )
Original file line number Diff line number Diff line change @@ -26,20 +26,6 @@ def load(self):
26
26
self ._model = imp .load_pickle (package_name , model_pickle_filename )
27
27
self ._model_dtype = list (self ._model .parameters ())[0 ].dtype
28
28
29
- def preprocess (self , model_input : Any ) -> Any :
30
- """
31
- Incorporate pre-processing required by the model if desired here.
32
-
33
- These might be feature transformations that are tightly coupled to the model.
34
- """
35
- return model_input
36
-
37
- def postprocess (self , model_output : Any ) -> Any :
38
- """
39
- Incorporate post-processing required by the model if desired here.
40
- """
41
- return model_output
42
-
43
29
def predict (self , model_input : Any ) -> Any :
44
30
model_output = {}
45
31
with torch .no_grad ():
Original file line number Diff line number Diff line change @@ -24,20 +24,6 @@ def load(self):
24
24
model_file_path = next (path for path in paths if path .exists ())
25
25
self ._model = joblib .load (model_file_path )
26
26
27
- def preprocess (self , model_input : Any ) -> Any :
28
- """
29
- Incorporate pre-processing required by the model if desired here.
30
-
31
- These might be feature transformations that are tightly coupled to the model.
32
- """
33
- return model_input
34
-
35
- def postprocess (self , model_output : Any ) -> Any :
36
- """
37
- Incorporate post-processing required by the model if desired here.
38
- """
39
- return model_output
40
-
41
27
def predict (self , model_input : Any ) -> Any :
42
28
model_output = {}
43
29
result = self ._model .predict (model_input )
Original file line number Diff line number Diff line change @@ -31,20 +31,6 @@ def load(self):
31
31
self ._model = xgb .Booster ()
32
32
self ._model .load_model (model_file_path )
33
33
34
- def preprocess (self , model_input : Any ) -> Any :
35
- """
36
- Incorporate pre-processing required by the model if desired here.
37
-
38
- These might be feature transformations that are tightly coupled to the model.
39
- """
40
- return model_input
41
-
42
- def postprocess (self , model_output : Any ) -> Any :
43
- """
44
- Incorporate post-processing required by the model if desired here.
45
- """
46
- return model_output
47
-
48
34
def predict (self , model_input : Any ) -> Any :
49
35
model_output = {}
50
36
dmatrix_inputs = xgb .DMatrix (model_input )
Original file line number Diff line number Diff line change 1
- from typing import Any , Dict , List
1
+ from typing import Any
2
2
3
3
4
4
class Model :
@@ -12,21 +12,7 @@ def load(self):
12
12
# Load model here and assign to self._model.
13
13
pass
14
14
15
- def preprocess (self , model_input : Any ) -> Any :
16
- """
17
- Incorporate pre-processing required by the model if desired here.
18
-
19
- These might be feature transformations that are tightly coupled to the model.
20
- """
21
- return model_input
22
-
23
- def postprocess (self , model_output : Dict ) -> Dict :
24
- """
25
- Incorporate post-processing required by the model if desired here.
26
- """
27
- return model_output
28
-
29
- def predict (self , model_input : Dict ) -> Dict [str , List ]:
15
+ def predict (self , model_input : Any ) -> Any :
30
16
model_output = {}
31
17
# Invoke model on model_input and calculate predictions here.
32
18
model_output ["predictions" ] = []
You can’t perform that action at this time.
0 commit comments