File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -81,21 +81,14 @@ class InferencePipeline(ls.LitAPI):
8181 self .model1 = lambda x : x** 2
8282 self .model2 = lambda x : x** 3
8383
84- def decode_request (self , request ):
85- # get inputs to /predict
86- return request[" input" ]
87-
88- def predict (self , x ):
84+ def predict (self , request ):
85+ x = request[" input" ]
8986 # perform calculations using both models
9087 a = self .model1(x)
9188 b = self .model2(x)
9289 c = a + b
9390 return {" output" : c}
9491
95- def encode_response (self , output ):
96- # package outputs from /predict
97- return {" output" : output}
98-
9992if __name__ == " __main__" :
10093 # 12+ features like batching, streaming, etc...
10194 server = ls.LitServer(InferencePipeline(max_batch_size = 1 ), accelerator = " auto" )
You can’t perform that action at this time.
0 commit comments