INNER CODE UNIT · Python
encode_response
CerebriumAI/examples · 10-batching/2-litserve-batching-gpu/main.py:21
def encode_response(self, output):
print("encode_response")
return output["label"]
api = TextClassificationAPI()
server = ls.LitServer(api, max_batch_size=4, batch_timeout=20)
app = server.app
# health check endpoint
@app.get("/health")
def health():
return {"status": "healthy"}
if __name__ == "__main__":
server.run(port=8000)