def generate_test_requests() -> List[SeldonMessage]: max_value = 9999 requests = [] inputs = max_value * np.random.rand(1024) requests.append( SeldonMessage(data=DefaultData( tensor=Tensor(shape=inputs.shape, values=inputs)))) return requests
def main(): model = NoJava() # model = Baseline() # model = ProtobufEncoding() model = PayloadPassthrough() model.load() # payload = np.array([0.0, 1.1, 2.2, 3.3]) # prediction = model.predict(payload) # message = SeldonMessage( # data=DefaultData(tensor=Tensor(shape=[1], values=[0.0, 1.1, 2.2, 3.3])) # ) # prediction = model.predict_raw(message) for n in range(100000): message = SeldonMessage(data=DefaultData( tensor=Tensor(shape=[1], values=[0.0, 1.1, 2.2, 3.3]))) prediction = model.predict_raw(MessageToJson(message)) print(f"[PYTHON] Prediction was {prediction}")