INNER CODE UNIT · Python
predict
CerebriumAI/examples · 10-batching/1-litserve-batching-cpu/main.py:14
def predict(self, x):
print("predict")
result = self.model(x)
return result
def encode_response(self, output):
print("encode_response")
return {"output": output}
api = SimpleBatchedAPI()
server = ls.LitServer(api, max_batch_size=3, batch_timeout=20)
app = server.app
# health check endpoint
@app.get("/health")
def health():