use of io.seldon.engine.predictors.PredictorState in project seldon-core by SeldonIO.
the class PredictionService method sendFeedback.
public void sendFeedback(Feedback feedback) throws InterruptedException, ExecutionException, InvalidProtocolBufferException {
PredictorState predictorState = predictorBean.predictorStateFromPredictorSpec(enginePredictor.getPredictorSpec());
predictorBean.sendFeedback(feedback, predictorState);
return;
}
use of io.seldon.engine.predictors.PredictorState in project seldon-core by SeldonIO.
the class PredictionService method predict.
public SeldonMessage predict(SeldonMessage request) throws InterruptedException, ExecutionException, InvalidProtocolBufferException {
if (!request.hasMeta()) {
request = request.toBuilder().setMeta(Meta.newBuilder().setPuid(puidGenerator.nextPuidId()).build()).build();
} else if (StringUtils.isEmpty(request.getMeta().getPuid())) {
request = request.toBuilder().setMeta(request.getMeta().toBuilder().setPuid(puidGenerator.nextPuidId()).build()).build();
}
String puid = request.getMeta().getPuid();
PredictorState predictorState = predictorBean.predictorStateFromPredictorSpec(enginePredictor.getPredictorSpec());
SeldonMessage predictorReturn = predictorBean.predict(request, predictorState);
SeldonMessage.Builder builder = SeldonMessage.newBuilder(predictorReturn).setMeta(Meta.newBuilder(predictorReturn.getMeta()).setPuid(puid));
return builder.build();
}
Aggregations