INNER CODE UNIT · Python
predict
CerebriumAI/examples · 10-batching/2-litserve-batching-gpu/main.py:16
def predict(self, x):
print("predict")
result = self.model(x)
return result
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():