Skip to content

Commit b78f8ce

Browse files
authored
remove decode and encode (#515)
1 parent 368e1d6 commit b78f8ce

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

README.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff 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-
9992
if __name__ == "__main__":
10093
# 12+ features like batching, streaming, etc...
10194
server = ls.LitServer(InferencePipeline(max_batch_size=1), accelerator="auto")

0 commit comments

Comments
 (0)