Slackbot
10/11/2022, 10:41 PMShihgian Lee
10/11/2022, 11:45 PMShihgian Lee
10/11/2022, 11:51 PMThe order of the requests in a batch is not guaranteed
. If I need to post-process the batch prediction returned by the model, what is the impact or things I need to pay attention to?Shihgian Lee
10/12/2022, 2:17 PMBo
10/12/2022, 6:46 PMBo
10/12/2022, 6:49 PM@api(input=JSON(), output=JSON())
def predict(input_json_req):
domain_request = Mappings.to_domain(input_json_req)
domain_df = pd.DataFrame(domain_request)
result = prediction_runner.predict.run(domain_df)
return JsonSerializer.to_json(result)
Bo
10/12/2022, 6:51 PMShihgian Lee
10/12/2022, 7:52 PMinput_spec = JSON(pydantic_model=InputFeatures)
my_runner = bentoml.Runner(MyRunnable, name='my_runnable')
svc = bentoml.Service('my_service', runners=[my_runner])
@svc.api(input=input_spec, output=NumpyNdarray())
def predict(input_data: InputFeatures):
input_df = pd.DataFrame([input_data.dict()])
return my_runner.predict.run(input_data)
Is my understanding correct?
my_runner.predict.run(input_data)
returns a list of Shihgian Lee
10/12/2022, 9:46 PM