INNER CODE UNIT · Python
encode_response
CerebriumAI/examples · 10-batching/1-litserve-batching-cpu/main.py:19
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():
return {"status": "healthy"}
if __name__ == "__main__":
server.run(port=8000)