We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d8710e commit 6eb983bCopy full SHA for 6eb983b
README.md
@@ -78,12 +78,21 @@ class SimpleLitAPI(ls.LitAPI):
78
self.model1 = lambda x: x**2
79
self.model2 = lambda x: x**3
80
81
+ def decode_request(self, request):
82
+ # get inputs to /predict
83
+ return request["input"]
84
+
85
def predict(self, x):
86
+ # perform calculations using both models
87
a = self.model1(x)
88
b = self.model2(x)
89
c = a + b
90
return {"output": c}
91
92
+ def encode_response(self, output):
93
+ # package outputs from /predict
94
+ return {"output": output}
95
96
if __name__ == "__main__":
97
# 12+ features like batching, streaming, etc...
98
server = ls.LitServer(SimpleLitAPI(max_batch_size=1), accelerator="auto")
0 commit comments