diff --git a/benchmarking/testserver/models/text-model/models.py b/benchmarking/testserver/models/text-model/text-model.py similarity index 100% rename from benchmarking/testserver/models/text-model/models.py rename to benchmarking/testserver/models/text-model/text-model.py diff --git a/mlserver/batching/hooks.py b/mlserver/batching/hooks.py index d2b4daf07..ac9d75a5e 100644 --- a/mlserver/batching/hooks.py +++ b/mlserver/batching/hooks.py @@ -1,5 +1,5 @@ from functools import wraps -from typing import Awaitable, Callable, Optional, AsyncIterable +from typing import Awaitable, Callable, Optional, AsyncIterator from ..errors import MLServerError from ..model import MLModel @@ -55,7 +55,7 @@ async def _inner(payload: InferenceRequest) -> InferenceResponse: def not_implemented_warning( - f: Callable[[AsyncIterable[InferenceResponse]], AsyncIterable[InferenceResponse]], + f: Callable[[AsyncIterator[InferenceRequest]], AsyncIterator[InferenceResponse]], ): """ Decorator to lets users know that adaptive batching is not required on @@ -69,8 +69,8 @@ def not_implemented_warning( @wraps(f) async def _inner_stream( - payload: InferenceRequest, - ) -> AsyncIterable[InferenceResponse]: + payload: AsyncIterator[InferenceRequest], + ) -> AsyncIterator[InferenceResponse]: model = _get_model(f) logger.warning( warning_template.format(model_name=model.name, f_name=f.__name__) diff --git a/mlserver/grpc/dataplane_pb2.py b/mlserver/grpc/dataplane_pb2.py index f61cdf579..2e25d3ad2 100644 --- a/mlserver/grpc/dataplane_pb2.py +++ b/mlserver/grpc/dataplane_pb2.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! -# source: mlserver/grpc/dataplane.proto -# Protobuf Python Version: 4.25.1 +# source: dataplane.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) @@ -14,139 +14,579 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x1dmlserver/grpc/dataplane.proto\x12\tinference"3\n\x0cHelloRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x15\n\rnum_greetings\x18\x02 \x01(\t"\x1d\n\nHelloReply\x12\x0f\n\x07message\x18\x01 \x01(\t"\x13\n\x11ServerLiveRequest""\n\x12ServerLiveResponse\x12\x0c\n\x04live\x18\x01 \x01(\x08"\x14\n\x12ServerReadyRequest"$\n\x13ServerReadyResponse\x12\r\n\x05ready\x18\x01 \x01(\x08"2\n\x11ModelReadyRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t"#\n\x12ModelReadyResponse\x12\r\n\x05ready\x18\x01 \x01(\x08"\x17\n\x15ServerMetadataRequest"K\n\x16ServerMetadataResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x12\n\nextensions\x18\x03 \x03(\t"5\n\x14ModelMetadataRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t"\xc5\x04\n\x15ModelMetadataResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08versions\x18\x02 \x03(\t\x12\x10\n\x08platform\x18\x03 \x01(\t\x12?\n\x06inputs\x18\x04 \x03(\x0b\x32/.inference.ModelMetadataResponse.TensorMetadata\x12@\n\x07outputs\x18\x05 \x03(\x0b\x32/.inference.ModelMetadataResponse.TensorMetadata\x12\x44\n\nparameters\x18\x06 \x03(\x0b\x32\x30.inference.ModelMetadataResponse.ParametersEntry\x1a\xe2\x01\n\x0eTensorMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08\x64\x61tatype\x18\x02 \x01(\t\x12\r\n\x05shape\x18\x03 \x03(\x03\x12S\n\nparameters\x18\x04 \x03(\x0b\x32?.inference.ModelMetadataResponse.TensorMetadata.ParametersEntry\x1aL\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.inference.InferParameter:\x02\x38\x01\x1aL\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.inference.InferParameter:\x02\x38\x01"\xee\x06\n\x11ModelInferRequest\x12\x12\n\nmodel_name\x18\x01 \x01(\t\x12\x15\n\rmodel_version\x18\x02 \x01(\t\x12\n\n\x02id\x18\x03 \x01(\t\x12@\n\nparameters\x18\x04 \x03(\x0b\x32,.inference.ModelInferRequest.ParametersEntry\x12=\n\x06inputs\x18\x05 \x03(\x0b\x32-.inference.ModelInferRequest.InferInputTensor\x12H\n\x07outputs\x18\x06 \x03(\x0b\x32\x37.inference.ModelInferRequest.InferRequestedOutputTensor\x12\x1a\n\x12raw_input_contents\x18\x07 \x03(\x0c\x1a\x94\x02\n\x10InferInputTensor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08\x64\x61tatype\x18\x02 \x01(\t\x12\r\n\x05shape\x18\x03 \x03(\x03\x12Q\n\nparameters\x18\x04 \x03(\x0b\x32=.inference.ModelInferRequest.InferInputTensor.ParametersEntry\x12\x30\n\x08\x63ontents\x18\x05 \x01(\x0b\x32\x1e.inference.InferTensorContents\x1aL\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.inference.InferParameter:\x02\x38\x01\x1a\xd5\x01\n\x1aInferRequestedOutputTensor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12[\n\nparameters\x18\x02 \x03(\x0b\x32G.inference.ModelInferRequest.InferRequestedOutputTensor.ParametersEntry\x1aL\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.inference.InferParameter:\x02\x38\x01\x1aL\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.inference.InferParameter:\x02\x38\x01"\xd5\x04\n\x12ModelInferResponse\x12\x12\n\nmodel_name\x18\x01 \x01(\t\x12\x15\n\rmodel_version\x18\x02 \x01(\t\x12\n\n\x02id\x18\x03 \x01(\t\x12\x41\n\nparameters\x18\x04 \x03(\x0b\x32-.inference.ModelInferResponse.ParametersEntry\x12@\n\x07outputs\x18\x05 \x03(\x0b\x32/.inference.ModelInferResponse.InferOutputTensor\x12\x1b\n\x13raw_output_contents\x18\x06 \x03(\x0c\x1a\x97\x02\n\x11InferOutputTensor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08\x64\x61tatype\x18\x02 \x01(\t\x12\r\n\x05shape\x18\x03 \x03(\x03\x12S\n\nparameters\x18\x04 \x03(\x0b\x32?.inference.ModelInferResponse.InferOutputTensor.ParametersEntry\x12\x30\n\x08\x63ontents\x18\x05 \x01(\x0b\x32\x1e.inference.InferTensorContents\x1aL\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.inference.InferParameter:\x02\x38\x01\x1aL\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.inference.InferParameter:\x02\x38\x01"i\n\x0eInferParameter\x12\x14\n\nbool_param\x18\x01 \x01(\x08H\x00\x12\x15\n\x0bint64_param\x18\x02 \x01(\x03H\x00\x12\x16\n\x0cstring_param\x18\x03 \x01(\tH\x00\x42\x12\n\x10parameter_choice"\xd0\x01\n\x13InferTensorContents\x12\x15\n\rbool_contents\x18\x01 \x03(\x08\x12\x14\n\x0cint_contents\x18\x02 \x03(\x05\x12\x16\n\x0eint64_contents\x18\x03 \x03(\x03\x12\x15\n\ruint_contents\x18\x04 \x03(\r\x12\x17\n\x0fuint64_contents\x18\x05 \x03(\x04\x12\x15\n\rfp32_contents\x18\x06 \x03(\x02\x12\x15\n\rfp64_contents\x18\x07 \x03(\x01\x12\x16\n\x0e\x62ytes_contents\x18\x08 \x03(\x0c"\x8a\x01\n\x18ModelRepositoryParameter\x12\x14\n\nbool_param\x18\x01 \x01(\x08H\x00\x12\x15\n\x0bint64_param\x18\x02 \x01(\x03H\x00\x12\x16\n\x0cstring_param\x18\x03 \x01(\tH\x00\x12\x15\n\x0b\x62ytes_param\x18\x04 \x01(\x0cH\x00\x42\x12\n\x10parameter_choice"@\n\x16RepositoryIndexRequest\x12\x17\n\x0frepository_name\x18\x01 \x01(\t\x12\r\n\x05ready\x18\x02 \x01(\x08"\xa4\x01\n\x17RepositoryIndexResponse\x12=\n\x06models\x18\x01 \x03(\x0b\x32-.inference.RepositoryIndexResponse.ModelIndex\x1aJ\n\nModelIndex\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\r\n\x05state\x18\x03 \x01(\t\x12\x0e\n\x06reason\x18\x04 \x01(\t"\xec\x01\n\x1aRepositoryModelLoadRequest\x12\x17\n\x0frepository_name\x18\x01 \x01(\t\x12\x12\n\nmodel_name\x18\x02 \x01(\t\x12I\n\nparameters\x18\x03 \x03(\x0b\x32\x35.inference.RepositoryModelLoadRequest.ParametersEntry\x1aV\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x32\n\x05value\x18\x02 \x01(\x0b\x32#.inference.ModelRepositoryParameter:\x02\x38\x01"\x1d\n\x1bRepositoryModelLoadResponse"\xf0\x01\n\x1cRepositoryModelUnloadRequest\x12\x17\n\x0frepository_name\x18\x01 \x01(\t\x12\x12\n\nmodel_name\x18\x02 \x01(\t\x12K\n\nparameters\x18\x03 \x03(\x0b\x32\x37.inference.RepositoryModelUnloadRequest.ParametersEntry\x1aV\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x32\n\x05value\x18\x02 \x01(\x0b\x32#.inference.ModelRepositoryParameter:\x02\x38\x01"\x1f\n\x1dRepositoryModelUnloadResponse2\x85\x07\n\x14GRPCInferenceService\x12K\n\nServerLive\x12\x1c.inference.ServerLiveRequest\x1a\x1d.inference.ServerLiveResponse"\x00\x12N\n\x0bServerReady\x12\x1d.inference.ServerReadyRequest\x1a\x1e.inference.ServerReadyResponse"\x00\x12K\n\nModelReady\x12\x1c.inference.ModelReadyRequest\x1a\x1d.inference.ModelReadyResponse"\x00\x12W\n\x0eServerMetadata\x12 .inference.ServerMetadataRequest\x1a!.inference.ServerMetadataResponse"\x00\x12T\n\rModelMetadata\x12\x1f.inference.ModelMetadataRequest\x1a .inference.ModelMetadataResponse"\x00\x12K\n\nModelInfer\x12\x1c.inference.ModelInferRequest\x1a\x1d.inference.ModelInferResponse"\x00\x12U\n\x10ModelStreamInfer\x12\x1c.inference.ModelInferRequest\x1a\x1d.inference.ModelInferResponse"\x00(\x01\x30\x01\x12Z\n\x0fRepositoryIndex\x12!.inference.RepositoryIndexRequest\x1a".inference.RepositoryIndexResponse"\x00\x12\x66\n\x13RepositoryModelLoad\x12%.inference.RepositoryModelLoadRequest\x1a&.inference.RepositoryModelLoadResponse"\x00\x12l\n\x15RepositoryModelUnload\x12\'.inference.RepositoryModelUnloadRequest\x1a(.inference.RepositoryModelUnloadResponse"\x00\x42\x0f\n\x07\x65x.grpc\xa2\x02\x03HSWb\x06proto3' + b'\n\x0f\x64\x61taplane.proto\x12\tinference"3\n\x0cHelloRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x15\n\rnum_greetings\x18\x02 \x01(\t"\x1d\n\nHelloReply\x12\x0f\n\x07message\x18\x01 \x01(\t"\x13\n\x11ServerLiveRequest""\n\x12ServerLiveResponse\x12\x0c\n\x04live\x18\x01 \x01(\x08"\x14\n\x12ServerReadyRequest"$\n\x13ServerReadyResponse\x12\r\n\x05ready\x18\x01 \x01(\x08"2\n\x11ModelReadyRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t"#\n\x12ModelReadyResponse\x12\r\n\x05ready\x18\x01 \x01(\x08"\x17\n\x15ServerMetadataRequest"K\n\x16ServerMetadataResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x12\n\nextensions\x18\x03 \x03(\t"5\n\x14ModelMetadataRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t"\xc5\x04\n\x15ModelMetadataResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08versions\x18\x02 \x03(\t\x12\x10\n\x08platform\x18\x03 \x01(\t\x12?\n\x06inputs\x18\x04 \x03(\x0b\x32/.inference.ModelMetadataResponse.TensorMetadata\x12@\n\x07outputs\x18\x05 \x03(\x0b\x32/.inference.ModelMetadataResponse.TensorMetadata\x12\x44\n\nparameters\x18\x06 \x03(\x0b\x32\x30.inference.ModelMetadataResponse.ParametersEntry\x1a\xe2\x01\n\x0eTensorMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08\x64\x61tatype\x18\x02 \x01(\t\x12\r\n\x05shape\x18\x03 \x03(\x03\x12S\n\nparameters\x18\x04 \x03(\x0b\x32?.inference.ModelMetadataResponse.TensorMetadata.ParametersEntry\x1aL\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.inference.InferParameter:\x02\x38\x01\x1aL\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.inference.InferParameter:\x02\x38\x01"\xee\x06\n\x11ModelInferRequest\x12\x12\n\nmodel_name\x18\x01 \x01(\t\x12\x15\n\rmodel_version\x18\x02 \x01(\t\x12\n\n\x02id\x18\x03 \x01(\t\x12@\n\nparameters\x18\x04 \x03(\x0b\x32,.inference.ModelInferRequest.ParametersEntry\x12=\n\x06inputs\x18\x05 \x03(\x0b\x32-.inference.ModelInferRequest.InferInputTensor\x12H\n\x07outputs\x18\x06 \x03(\x0b\x32\x37.inference.ModelInferRequest.InferRequestedOutputTensor\x12\x1a\n\x12raw_input_contents\x18\x07 \x03(\x0c\x1a\x94\x02\n\x10InferInputTensor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08\x64\x61tatype\x18\x02 \x01(\t\x12\r\n\x05shape\x18\x03 \x03(\x03\x12Q\n\nparameters\x18\x04 \x03(\x0b\x32=.inference.ModelInferRequest.InferInputTensor.ParametersEntry\x12\x30\n\x08\x63ontents\x18\x05 \x01(\x0b\x32\x1e.inference.InferTensorContents\x1aL\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.inference.InferParameter:\x02\x38\x01\x1a\xd5\x01\n\x1aInferRequestedOutputTensor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12[\n\nparameters\x18\x02 \x03(\x0b\x32G.inference.ModelInferRequest.InferRequestedOutputTensor.ParametersEntry\x1aL\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.inference.InferParameter:\x02\x38\x01\x1aL\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.inference.InferParameter:\x02\x38\x01"\xd5\x04\n\x12ModelInferResponse\x12\x12\n\nmodel_name\x18\x01 \x01(\t\x12\x15\n\rmodel_version\x18\x02 \x01(\t\x12\n\n\x02id\x18\x03 \x01(\t\x12\x41\n\nparameters\x18\x04 \x03(\x0b\x32-.inference.ModelInferResponse.ParametersEntry\x12@\n\x07outputs\x18\x05 \x03(\x0b\x32/.inference.ModelInferResponse.InferOutputTensor\x12\x1b\n\x13raw_output_contents\x18\x06 \x03(\x0c\x1a\x97\x02\n\x11InferOutputTensor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08\x64\x61tatype\x18\x02 \x01(\t\x12\r\n\x05shape\x18\x03 \x03(\x03\x12S\n\nparameters\x18\x04 \x03(\x0b\x32?.inference.ModelInferResponse.InferOutputTensor.ParametersEntry\x12\x30\n\x08\x63ontents\x18\x05 \x01(\x0b\x32\x1e.inference.InferTensorContents\x1aL\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.inference.InferParameter:\x02\x38\x01\x1aL\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.inference.InferParameter:\x02\x38\x01"i\n\x0eInferParameter\x12\x14\n\nbool_param\x18\x01 \x01(\x08H\x00\x12\x15\n\x0bint64_param\x18\x02 \x01(\x03H\x00\x12\x16\n\x0cstring_param\x18\x03 \x01(\tH\x00\x42\x12\n\x10parameter_choice"\xd0\x01\n\x13InferTensorContents\x12\x15\n\rbool_contents\x18\x01 \x03(\x08\x12\x14\n\x0cint_contents\x18\x02 \x03(\x05\x12\x16\n\x0eint64_contents\x18\x03 \x03(\x03\x12\x15\n\ruint_contents\x18\x04 \x03(\r\x12\x17\n\x0fuint64_contents\x18\x05 \x03(\x04\x12\x15\n\rfp32_contents\x18\x06 \x03(\x02\x12\x15\n\rfp64_contents\x18\x07 \x03(\x01\x12\x16\n\x0e\x62ytes_contents\x18\x08 \x03(\x0c"\x8a\x01\n\x18ModelRepositoryParameter\x12\x14\n\nbool_param\x18\x01 \x01(\x08H\x00\x12\x15\n\x0bint64_param\x18\x02 \x01(\x03H\x00\x12\x16\n\x0cstring_param\x18\x03 \x01(\tH\x00\x12\x15\n\x0b\x62ytes_param\x18\x04 \x01(\x0cH\x00\x42\x12\n\x10parameter_choice"@\n\x16RepositoryIndexRequest\x12\x17\n\x0frepository_name\x18\x01 \x01(\t\x12\r\n\x05ready\x18\x02 \x01(\x08"\xa4\x01\n\x17RepositoryIndexResponse\x12=\n\x06models\x18\x01 \x03(\x0b\x32-.inference.RepositoryIndexResponse.ModelIndex\x1aJ\n\nModelIndex\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\r\n\x05state\x18\x03 \x01(\t\x12\x0e\n\x06reason\x18\x04 \x01(\t"\xec\x01\n\x1aRepositoryModelLoadRequest\x12\x17\n\x0frepository_name\x18\x01 \x01(\t\x12\x12\n\nmodel_name\x18\x02 \x01(\t\x12I\n\nparameters\x18\x03 \x03(\x0b\x32\x35.inference.RepositoryModelLoadRequest.ParametersEntry\x1aV\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x32\n\x05value\x18\x02 \x01(\x0b\x32#.inference.ModelRepositoryParameter:\x02\x38\x01"\x1d\n\x1bRepositoryModelLoadResponse"\xf0\x01\n\x1cRepositoryModelUnloadRequest\x12\x17\n\x0frepository_name\x18\x01 \x01(\t\x12\x12\n\nmodel_name\x18\x02 \x01(\t\x12K\n\nparameters\x18\x03 \x03(\x0b\x32\x37.inference.RepositoryModelUnloadRequest.ParametersEntry\x1aV\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x32\n\x05value\x18\x02 \x01(\x0b\x32#.inference.ModelRepositoryParameter:\x02\x38\x01"\x1f\n\x1dRepositoryModelUnloadResponse2\x85\x07\n\x14GRPCInferenceService\x12K\n\nServerLive\x12\x1c.inference.ServerLiveRequest\x1a\x1d.inference.ServerLiveResponse"\x00\x12N\n\x0bServerReady\x12\x1d.inference.ServerReadyRequest\x1a\x1e.inference.ServerReadyResponse"\x00\x12K\n\nModelReady\x12\x1c.inference.ModelReadyRequest\x1a\x1d.inference.ModelReadyResponse"\x00\x12W\n\x0eServerMetadata\x12 .inference.ServerMetadataRequest\x1a!.inference.ServerMetadataResponse"\x00\x12T\n\rModelMetadata\x12\x1f.inference.ModelMetadataRequest\x1a .inference.ModelMetadataResponse"\x00\x12K\n\nModelInfer\x12\x1c.inference.ModelInferRequest\x1a\x1d.inference.ModelInferResponse"\x00\x12U\n\x10ModelStreamInfer\x12\x1c.inference.ModelInferRequest\x1a\x1d.inference.ModelInferResponse"\x00(\x01\x30\x01\x12Z\n\x0fRepositoryIndex\x12!.inference.RepositoryIndexRequest\x1a".inference.RepositoryIndexResponse"\x00\x12\x66\n\x13RepositoryModelLoad\x12%.inference.RepositoryModelLoadRequest\x1a&.inference.RepositoryModelLoadResponse"\x00\x12l\n\x15RepositoryModelUnload\x12\'.inference.RepositoryModelUnloadRequest\x1a(.inference.RepositoryModelUnloadResponse"\x00\x42\x0f\n\x07\x65x.grpc\xa2\x02\x03HSWb\x06proto3' ) -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages( - DESCRIPTOR, "mlserver.grpc.dataplane_pb2", _globals + +_HELLOREQUEST = DESCRIPTOR.message_types_by_name["HelloRequest"] +_HELLOREPLY = DESCRIPTOR.message_types_by_name["HelloReply"] +_SERVERLIVEREQUEST = DESCRIPTOR.message_types_by_name["ServerLiveRequest"] +_SERVERLIVERESPONSE = DESCRIPTOR.message_types_by_name["ServerLiveResponse"] +_SERVERREADYREQUEST = DESCRIPTOR.message_types_by_name["ServerReadyRequest"] +_SERVERREADYRESPONSE = DESCRIPTOR.message_types_by_name["ServerReadyResponse"] +_MODELREADYREQUEST = DESCRIPTOR.message_types_by_name["ModelReadyRequest"] +_MODELREADYRESPONSE = DESCRIPTOR.message_types_by_name["ModelReadyResponse"] +_SERVERMETADATAREQUEST = DESCRIPTOR.message_types_by_name["ServerMetadataRequest"] +_SERVERMETADATARESPONSE = DESCRIPTOR.message_types_by_name["ServerMetadataResponse"] +_MODELMETADATAREQUEST = DESCRIPTOR.message_types_by_name["ModelMetadataRequest"] +_MODELMETADATARESPONSE = DESCRIPTOR.message_types_by_name["ModelMetadataResponse"] +_MODELMETADATARESPONSE_TENSORMETADATA = _MODELMETADATARESPONSE.nested_types_by_name[ + "TensorMetadata" +] +_MODELMETADATARESPONSE_TENSORMETADATA_PARAMETERSENTRY = ( + _MODELMETADATARESPONSE_TENSORMETADATA.nested_types_by_name["ParametersEntry"] +) +_MODELMETADATARESPONSE_PARAMETERSENTRY = _MODELMETADATARESPONSE.nested_types_by_name[ + "ParametersEntry" +] +_MODELINFERREQUEST = DESCRIPTOR.message_types_by_name["ModelInferRequest"] +_MODELINFERREQUEST_INFERINPUTTENSOR = _MODELINFERREQUEST.nested_types_by_name[ + "InferInputTensor" +] +_MODELINFERREQUEST_INFERINPUTTENSOR_PARAMETERSENTRY = ( + _MODELINFERREQUEST_INFERINPUTTENSOR.nested_types_by_name["ParametersEntry"] +) +_MODELINFERREQUEST_INFERREQUESTEDOUTPUTTENSOR = _MODELINFERREQUEST.nested_types_by_name[ + "InferRequestedOutputTensor" +] +_MODELINFERREQUEST_INFERREQUESTEDOUTPUTTENSOR_PARAMETERSENTRY = ( + _MODELINFERREQUEST_INFERREQUESTEDOUTPUTTENSOR.nested_types_by_name[ + "ParametersEntry" + ] +) +_MODELINFERREQUEST_PARAMETERSENTRY = _MODELINFERREQUEST.nested_types_by_name[ + "ParametersEntry" +] +_MODELINFERRESPONSE = DESCRIPTOR.message_types_by_name["ModelInferResponse"] +_MODELINFERRESPONSE_INFEROUTPUTTENSOR = _MODELINFERRESPONSE.nested_types_by_name[ + "InferOutputTensor" +] +_MODELINFERRESPONSE_INFEROUTPUTTENSOR_PARAMETERSENTRY = ( + _MODELINFERRESPONSE_INFEROUTPUTTENSOR.nested_types_by_name["ParametersEntry"] +) +_MODELINFERRESPONSE_PARAMETERSENTRY = _MODELINFERRESPONSE.nested_types_by_name[ + "ParametersEntry" +] +_INFERPARAMETER = DESCRIPTOR.message_types_by_name["InferParameter"] +_INFERTENSORCONTENTS = DESCRIPTOR.message_types_by_name["InferTensorContents"] +_MODELREPOSITORYPARAMETER = DESCRIPTOR.message_types_by_name["ModelRepositoryParameter"] +_REPOSITORYINDEXREQUEST = DESCRIPTOR.message_types_by_name["RepositoryIndexRequest"] +_REPOSITORYINDEXRESPONSE = DESCRIPTOR.message_types_by_name["RepositoryIndexResponse"] +_REPOSITORYINDEXRESPONSE_MODELINDEX = _REPOSITORYINDEXRESPONSE.nested_types_by_name[ + "ModelIndex" +] +_REPOSITORYMODELLOADREQUEST = DESCRIPTOR.message_types_by_name[ + "RepositoryModelLoadRequest" +] +_REPOSITORYMODELLOADREQUEST_PARAMETERSENTRY = ( + _REPOSITORYMODELLOADREQUEST.nested_types_by_name["ParametersEntry"] +) +_REPOSITORYMODELLOADRESPONSE = DESCRIPTOR.message_types_by_name[ + "RepositoryModelLoadResponse" +] +_REPOSITORYMODELUNLOADREQUEST = DESCRIPTOR.message_types_by_name[ + "RepositoryModelUnloadRequest" +] +_REPOSITORYMODELUNLOADREQUEST_PARAMETERSENTRY = ( + _REPOSITORYMODELUNLOADREQUEST.nested_types_by_name["ParametersEntry"] +) +_REPOSITORYMODELUNLOADRESPONSE = DESCRIPTOR.message_types_by_name[ + "RepositoryModelUnloadResponse" +] +HelloRequest = _reflection.GeneratedProtocolMessageType( + "HelloRequest", + (_message.Message,), + { + "DESCRIPTOR": _HELLOREQUEST, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.HelloRequest) + }, +) +_sym_db.RegisterMessage(HelloRequest) + +HelloReply = _reflection.GeneratedProtocolMessageType( + "HelloReply", + (_message.Message,), + { + "DESCRIPTOR": _HELLOREPLY, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.HelloReply) + }, +) +_sym_db.RegisterMessage(HelloReply) + +ServerLiveRequest = _reflection.GeneratedProtocolMessageType( + "ServerLiveRequest", + (_message.Message,), + { + "DESCRIPTOR": _SERVERLIVEREQUEST, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ServerLiveRequest) + }, +) +_sym_db.RegisterMessage(ServerLiveRequest) + +ServerLiveResponse = _reflection.GeneratedProtocolMessageType( + "ServerLiveResponse", + (_message.Message,), + { + "DESCRIPTOR": _SERVERLIVERESPONSE, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ServerLiveResponse) + }, +) +_sym_db.RegisterMessage(ServerLiveResponse) + +ServerReadyRequest = _reflection.GeneratedProtocolMessageType( + "ServerReadyRequest", + (_message.Message,), + { + "DESCRIPTOR": _SERVERREADYREQUEST, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ServerReadyRequest) + }, +) +_sym_db.RegisterMessage(ServerReadyRequest) + +ServerReadyResponse = _reflection.GeneratedProtocolMessageType( + "ServerReadyResponse", + (_message.Message,), + { + "DESCRIPTOR": _SERVERREADYRESPONSE, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ServerReadyResponse) + }, +) +_sym_db.RegisterMessage(ServerReadyResponse) + +ModelReadyRequest = _reflection.GeneratedProtocolMessageType( + "ModelReadyRequest", + (_message.Message,), + { + "DESCRIPTOR": _MODELREADYREQUEST, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ModelReadyRequest) + }, +) +_sym_db.RegisterMessage(ModelReadyRequest) + +ModelReadyResponse = _reflection.GeneratedProtocolMessageType( + "ModelReadyResponse", + (_message.Message,), + { + "DESCRIPTOR": _MODELREADYRESPONSE, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ModelReadyResponse) + }, ) +_sym_db.RegisterMessage(ModelReadyResponse) + +ServerMetadataRequest = _reflection.GeneratedProtocolMessageType( + "ServerMetadataRequest", + (_message.Message,), + { + "DESCRIPTOR": _SERVERMETADATAREQUEST, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ServerMetadataRequest) + }, +) +_sym_db.RegisterMessage(ServerMetadataRequest) + +ServerMetadataResponse = _reflection.GeneratedProtocolMessageType( + "ServerMetadataResponse", + (_message.Message,), + { + "DESCRIPTOR": _SERVERMETADATARESPONSE, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ServerMetadataResponse) + }, +) +_sym_db.RegisterMessage(ServerMetadataResponse) + +ModelMetadataRequest = _reflection.GeneratedProtocolMessageType( + "ModelMetadataRequest", + (_message.Message,), + { + "DESCRIPTOR": _MODELMETADATAREQUEST, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ModelMetadataRequest) + }, +) +_sym_db.RegisterMessage(ModelMetadataRequest) + +ModelMetadataResponse = _reflection.GeneratedProtocolMessageType( + "ModelMetadataResponse", + (_message.Message,), + { + "TensorMetadata": _reflection.GeneratedProtocolMessageType( + "TensorMetadata", + (_message.Message,), + { + "ParametersEntry": _reflection.GeneratedProtocolMessageType( + "ParametersEntry", + (_message.Message,), + { + "DESCRIPTOR": _MODELMETADATARESPONSE_TENSORMETADATA_PARAMETERSENTRY, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ModelMetadataResponse.TensorMetadata.ParametersEntry) + }, + ), + "DESCRIPTOR": _MODELMETADATARESPONSE_TENSORMETADATA, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ModelMetadataResponse.TensorMetadata) + }, + ), + "ParametersEntry": _reflection.GeneratedProtocolMessageType( + "ParametersEntry", + (_message.Message,), + { + "DESCRIPTOR": _MODELMETADATARESPONSE_PARAMETERSENTRY, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ModelMetadataResponse.ParametersEntry) + }, + ), + "DESCRIPTOR": _MODELMETADATARESPONSE, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ModelMetadataResponse) + }, +) +_sym_db.RegisterMessage(ModelMetadataResponse) +_sym_db.RegisterMessage(ModelMetadataResponse.TensorMetadata) +_sym_db.RegisterMessage(ModelMetadataResponse.TensorMetadata.ParametersEntry) +_sym_db.RegisterMessage(ModelMetadataResponse.ParametersEntry) + +ModelInferRequest = _reflection.GeneratedProtocolMessageType( + "ModelInferRequest", + (_message.Message,), + { + "InferInputTensor": _reflection.GeneratedProtocolMessageType( + "InferInputTensor", + (_message.Message,), + { + "ParametersEntry": _reflection.GeneratedProtocolMessageType( + "ParametersEntry", + (_message.Message,), + { + "DESCRIPTOR": _MODELINFERREQUEST_INFERINPUTTENSOR_PARAMETERSENTRY, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ModelInferRequest.InferInputTensor.ParametersEntry) + }, + ), + "DESCRIPTOR": _MODELINFERREQUEST_INFERINPUTTENSOR, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ModelInferRequest.InferInputTensor) + }, + ), + "InferRequestedOutputTensor": _reflection.GeneratedProtocolMessageType( + "InferRequestedOutputTensor", + (_message.Message,), + { + "ParametersEntry": _reflection.GeneratedProtocolMessageType( + "ParametersEntry", + (_message.Message,), + { + "DESCRIPTOR": _MODELINFERREQUEST_INFERREQUESTEDOUTPUTTENSOR_PARAMETERSENTRY, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ModelInferRequest.InferRequestedOutputTensor.ParametersEntry) + }, + ), + "DESCRIPTOR": _MODELINFERREQUEST_INFERREQUESTEDOUTPUTTENSOR, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ModelInferRequest.InferRequestedOutputTensor) + }, + ), + "ParametersEntry": _reflection.GeneratedProtocolMessageType( + "ParametersEntry", + (_message.Message,), + { + "DESCRIPTOR": _MODELINFERREQUEST_PARAMETERSENTRY, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ModelInferRequest.ParametersEntry) + }, + ), + "DESCRIPTOR": _MODELINFERREQUEST, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ModelInferRequest) + }, +) +_sym_db.RegisterMessage(ModelInferRequest) +_sym_db.RegisterMessage(ModelInferRequest.InferInputTensor) +_sym_db.RegisterMessage(ModelInferRequest.InferInputTensor.ParametersEntry) +_sym_db.RegisterMessage(ModelInferRequest.InferRequestedOutputTensor) +_sym_db.RegisterMessage(ModelInferRequest.InferRequestedOutputTensor.ParametersEntry) +_sym_db.RegisterMessage(ModelInferRequest.ParametersEntry) + +ModelInferResponse = _reflection.GeneratedProtocolMessageType( + "ModelInferResponse", + (_message.Message,), + { + "InferOutputTensor": _reflection.GeneratedProtocolMessageType( + "InferOutputTensor", + (_message.Message,), + { + "ParametersEntry": _reflection.GeneratedProtocolMessageType( + "ParametersEntry", + (_message.Message,), + { + "DESCRIPTOR": _MODELINFERRESPONSE_INFEROUTPUTTENSOR_PARAMETERSENTRY, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ModelInferResponse.InferOutputTensor.ParametersEntry) + }, + ), + "DESCRIPTOR": _MODELINFERRESPONSE_INFEROUTPUTTENSOR, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ModelInferResponse.InferOutputTensor) + }, + ), + "ParametersEntry": _reflection.GeneratedProtocolMessageType( + "ParametersEntry", + (_message.Message,), + { + "DESCRIPTOR": _MODELINFERRESPONSE_PARAMETERSENTRY, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ModelInferResponse.ParametersEntry) + }, + ), + "DESCRIPTOR": _MODELINFERRESPONSE, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ModelInferResponse) + }, +) +_sym_db.RegisterMessage(ModelInferResponse) +_sym_db.RegisterMessage(ModelInferResponse.InferOutputTensor) +_sym_db.RegisterMessage(ModelInferResponse.InferOutputTensor.ParametersEntry) +_sym_db.RegisterMessage(ModelInferResponse.ParametersEntry) + +InferParameter = _reflection.GeneratedProtocolMessageType( + "InferParameter", + (_message.Message,), + { + "DESCRIPTOR": _INFERPARAMETER, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.InferParameter) + }, +) +_sym_db.RegisterMessage(InferParameter) + +InferTensorContents = _reflection.GeneratedProtocolMessageType( + "InferTensorContents", + (_message.Message,), + { + "DESCRIPTOR": _INFERTENSORCONTENTS, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.InferTensorContents) + }, +) +_sym_db.RegisterMessage(InferTensorContents) + +ModelRepositoryParameter = _reflection.GeneratedProtocolMessageType( + "ModelRepositoryParameter", + (_message.Message,), + { + "DESCRIPTOR": _MODELREPOSITORYPARAMETER, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.ModelRepositoryParameter) + }, +) +_sym_db.RegisterMessage(ModelRepositoryParameter) + +RepositoryIndexRequest = _reflection.GeneratedProtocolMessageType( + "RepositoryIndexRequest", + (_message.Message,), + { + "DESCRIPTOR": _REPOSITORYINDEXREQUEST, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.RepositoryIndexRequest) + }, +) +_sym_db.RegisterMessage(RepositoryIndexRequest) + +RepositoryIndexResponse = _reflection.GeneratedProtocolMessageType( + "RepositoryIndexResponse", + (_message.Message,), + { + "ModelIndex": _reflection.GeneratedProtocolMessageType( + "ModelIndex", + (_message.Message,), + { + "DESCRIPTOR": _REPOSITORYINDEXRESPONSE_MODELINDEX, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.RepositoryIndexResponse.ModelIndex) + }, + ), + "DESCRIPTOR": _REPOSITORYINDEXRESPONSE, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.RepositoryIndexResponse) + }, +) +_sym_db.RegisterMessage(RepositoryIndexResponse) +_sym_db.RegisterMessage(RepositoryIndexResponse.ModelIndex) + +RepositoryModelLoadRequest = _reflection.GeneratedProtocolMessageType( + "RepositoryModelLoadRequest", + (_message.Message,), + { + "ParametersEntry": _reflection.GeneratedProtocolMessageType( + "ParametersEntry", + (_message.Message,), + { + "DESCRIPTOR": _REPOSITORYMODELLOADREQUEST_PARAMETERSENTRY, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.RepositoryModelLoadRequest.ParametersEntry) + }, + ), + "DESCRIPTOR": _REPOSITORYMODELLOADREQUEST, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.RepositoryModelLoadRequest) + }, +) +_sym_db.RegisterMessage(RepositoryModelLoadRequest) +_sym_db.RegisterMessage(RepositoryModelLoadRequest.ParametersEntry) + +RepositoryModelLoadResponse = _reflection.GeneratedProtocolMessageType( + "RepositoryModelLoadResponse", + (_message.Message,), + { + "DESCRIPTOR": _REPOSITORYMODELLOADRESPONSE, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.RepositoryModelLoadResponse) + }, +) +_sym_db.RegisterMessage(RepositoryModelLoadResponse) + +RepositoryModelUnloadRequest = _reflection.GeneratedProtocolMessageType( + "RepositoryModelUnloadRequest", + (_message.Message,), + { + "ParametersEntry": _reflection.GeneratedProtocolMessageType( + "ParametersEntry", + (_message.Message,), + { + "DESCRIPTOR": _REPOSITORYMODELUNLOADREQUEST_PARAMETERSENTRY, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.RepositoryModelUnloadRequest.ParametersEntry) + }, + ), + "DESCRIPTOR": _REPOSITORYMODELUNLOADREQUEST, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.RepositoryModelUnloadRequest) + }, +) +_sym_db.RegisterMessage(RepositoryModelUnloadRequest) +_sym_db.RegisterMessage(RepositoryModelUnloadRequest.ParametersEntry) + +RepositoryModelUnloadResponse = _reflection.GeneratedProtocolMessageType( + "RepositoryModelUnloadResponse", + (_message.Message,), + { + "DESCRIPTOR": _REPOSITORYMODELUNLOADRESPONSE, + "__module__": "dataplane_pb2", + # @@protoc_insertion_point(class_scope:inference.RepositoryModelUnloadResponse) + }, +) +_sym_db.RegisterMessage(RepositoryModelUnloadResponse) + +_GRPCINFERENCESERVICE = DESCRIPTOR.services_by_name["GRPCInferenceService"] if _descriptor._USE_C_DESCRIPTORS == False: - _globals["DESCRIPTOR"]._options = None - _globals["DESCRIPTOR"]._serialized_options = b"\n\007ex.grpc\242\002\003HSW" - _globals["_MODELMETADATARESPONSE_TENSORMETADATA_PARAMETERSENTRY"]._options = None - _globals[ - "_MODELMETADATARESPONSE_TENSORMETADATA_PARAMETERSENTRY" - ]._serialized_options = b"8\001" - _globals["_MODELMETADATARESPONSE_PARAMETERSENTRY"]._options = None - _globals["_MODELMETADATARESPONSE_PARAMETERSENTRY"]._serialized_options = b"8\001" - _globals["_MODELINFERREQUEST_INFERINPUTTENSOR_PARAMETERSENTRY"]._options = None - _globals[ - "_MODELINFERREQUEST_INFERINPUTTENSOR_PARAMETERSENTRY" - ]._serialized_options = b"8\001" - _globals[ - "_MODELINFERREQUEST_INFERREQUESTEDOUTPUTTENSOR_PARAMETERSENTRY" - ]._options = None - _globals[ - "_MODELINFERREQUEST_INFERREQUESTEDOUTPUTTENSOR_PARAMETERSENTRY" - ]._serialized_options = b"8\001" - _globals["_MODELINFERREQUEST_PARAMETERSENTRY"]._options = None - _globals["_MODELINFERREQUEST_PARAMETERSENTRY"]._serialized_options = b"8\001" - _globals["_MODELINFERRESPONSE_INFEROUTPUTTENSOR_PARAMETERSENTRY"]._options = None - _globals[ - "_MODELINFERRESPONSE_INFEROUTPUTTENSOR_PARAMETERSENTRY" - ]._serialized_options = b"8\001" - _globals["_MODELINFERRESPONSE_PARAMETERSENTRY"]._options = None - _globals["_MODELINFERRESPONSE_PARAMETERSENTRY"]._serialized_options = b"8\001" - _globals["_REPOSITORYMODELLOADREQUEST_PARAMETERSENTRY"]._options = None - _globals["_REPOSITORYMODELLOADREQUEST_PARAMETERSENTRY"]._serialized_options = ( - b"8\001" - ) - _globals["_REPOSITORYMODELUNLOADREQUEST_PARAMETERSENTRY"]._options = None - _globals["_REPOSITORYMODELUNLOADREQUEST_PARAMETERSENTRY"]._serialized_options = ( + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b"\n\007ex.grpc\242\002\003HSW" + _MODELMETADATARESPONSE_TENSORMETADATA_PARAMETERSENTRY._options = None + _MODELMETADATARESPONSE_TENSORMETADATA_PARAMETERSENTRY._serialized_options = b"8\001" + _MODELMETADATARESPONSE_PARAMETERSENTRY._options = None + _MODELMETADATARESPONSE_PARAMETERSENTRY._serialized_options = b"8\001" + _MODELINFERREQUEST_INFERINPUTTENSOR_PARAMETERSENTRY._options = None + _MODELINFERREQUEST_INFERINPUTTENSOR_PARAMETERSENTRY._serialized_options = b"8\001" + _MODELINFERREQUEST_INFERREQUESTEDOUTPUTTENSOR_PARAMETERSENTRY._options = None + _MODELINFERREQUEST_INFERREQUESTEDOUTPUTTENSOR_PARAMETERSENTRY._serialized_options = ( b"8\001" ) - _globals["_HELLOREQUEST"]._serialized_start = 44 - _globals["_HELLOREQUEST"]._serialized_end = 95 - _globals["_HELLOREPLY"]._serialized_start = 97 - _globals["_HELLOREPLY"]._serialized_end = 126 - _globals["_SERVERLIVEREQUEST"]._serialized_start = 128 - _globals["_SERVERLIVEREQUEST"]._serialized_end = 147 - _globals["_SERVERLIVERESPONSE"]._serialized_start = 149 - _globals["_SERVERLIVERESPONSE"]._serialized_end = 183 - _globals["_SERVERREADYREQUEST"]._serialized_start = 185 - _globals["_SERVERREADYREQUEST"]._serialized_end = 205 - _globals["_SERVERREADYRESPONSE"]._serialized_start = 207 - _globals["_SERVERREADYRESPONSE"]._serialized_end = 243 - _globals["_MODELREADYREQUEST"]._serialized_start = 245 - _globals["_MODELREADYREQUEST"]._serialized_end = 295 - _globals["_MODELREADYRESPONSE"]._serialized_start = 297 - _globals["_MODELREADYRESPONSE"]._serialized_end = 332 - _globals["_SERVERMETADATAREQUEST"]._serialized_start = 334 - _globals["_SERVERMETADATAREQUEST"]._serialized_end = 357 - _globals["_SERVERMETADATARESPONSE"]._serialized_start = 359 - _globals["_SERVERMETADATARESPONSE"]._serialized_end = 434 - _globals["_MODELMETADATAREQUEST"]._serialized_start = 436 - _globals["_MODELMETADATAREQUEST"]._serialized_end = 489 - _globals["_MODELMETADATARESPONSE"]._serialized_start = 492 - _globals["_MODELMETADATARESPONSE"]._serialized_end = 1073 - _globals["_MODELMETADATARESPONSE_TENSORMETADATA"]._serialized_start = 769 - _globals["_MODELMETADATARESPONSE_TENSORMETADATA"]._serialized_end = 995 - _globals[ - "_MODELMETADATARESPONSE_TENSORMETADATA_PARAMETERSENTRY" - ]._serialized_start = 919 - _globals[ - "_MODELMETADATARESPONSE_TENSORMETADATA_PARAMETERSENTRY" - ]._serialized_end = 995 - _globals["_MODELMETADATARESPONSE_PARAMETERSENTRY"]._serialized_start = 919 - _globals["_MODELMETADATARESPONSE_PARAMETERSENTRY"]._serialized_end = 995 - _globals["_MODELINFERREQUEST"]._serialized_start = 1076 - _globals["_MODELINFERREQUEST"]._serialized_end = 1954 - _globals["_MODELINFERREQUEST_INFERINPUTTENSOR"]._serialized_start = 1384 - _globals["_MODELINFERREQUEST_INFERINPUTTENSOR"]._serialized_end = 1660 - _globals[ - "_MODELINFERREQUEST_INFERINPUTTENSOR_PARAMETERSENTRY" - ]._serialized_start = 919 - _globals["_MODELINFERREQUEST_INFERINPUTTENSOR_PARAMETERSENTRY"]._serialized_end = ( - 995 + _MODELINFERREQUEST_PARAMETERSENTRY._options = None + _MODELINFERREQUEST_PARAMETERSENTRY._serialized_options = b"8\001" + _MODELINFERRESPONSE_INFEROUTPUTTENSOR_PARAMETERSENTRY._options = None + _MODELINFERRESPONSE_INFEROUTPUTTENSOR_PARAMETERSENTRY._serialized_options = b"8\001" + _MODELINFERRESPONSE_PARAMETERSENTRY._options = None + _MODELINFERRESPONSE_PARAMETERSENTRY._serialized_options = b"8\001" + _REPOSITORYMODELLOADREQUEST_PARAMETERSENTRY._options = None + _REPOSITORYMODELLOADREQUEST_PARAMETERSENTRY._serialized_options = b"8\001" + _REPOSITORYMODELUNLOADREQUEST_PARAMETERSENTRY._options = None + _REPOSITORYMODELUNLOADREQUEST_PARAMETERSENTRY._serialized_options = b"8\001" + _HELLOREQUEST._serialized_start = 30 + _HELLOREQUEST._serialized_end = 81 + _HELLOREPLY._serialized_start = 83 + _HELLOREPLY._serialized_end = 112 + _SERVERLIVEREQUEST._serialized_start = 114 + _SERVERLIVEREQUEST._serialized_end = 133 + _SERVERLIVERESPONSE._serialized_start = 135 + _SERVERLIVERESPONSE._serialized_end = 169 + _SERVERREADYREQUEST._serialized_start = 171 + _SERVERREADYREQUEST._serialized_end = 191 + _SERVERREADYRESPONSE._serialized_start = 193 + _SERVERREADYRESPONSE._serialized_end = 229 + _MODELREADYREQUEST._serialized_start = 231 + _MODELREADYREQUEST._serialized_end = 281 + _MODELREADYRESPONSE._serialized_start = 283 + _MODELREADYRESPONSE._serialized_end = 318 + _SERVERMETADATAREQUEST._serialized_start = 320 + _SERVERMETADATAREQUEST._serialized_end = 343 + _SERVERMETADATARESPONSE._serialized_start = 345 + _SERVERMETADATARESPONSE._serialized_end = 420 + _MODELMETADATAREQUEST._serialized_start = 422 + _MODELMETADATAREQUEST._serialized_end = 475 + _MODELMETADATARESPONSE._serialized_start = 478 + _MODELMETADATARESPONSE._serialized_end = 1059 + _MODELMETADATARESPONSE_TENSORMETADATA._serialized_start = 755 + _MODELMETADATARESPONSE_TENSORMETADATA._serialized_end = 981 + _MODELMETADATARESPONSE_TENSORMETADATA_PARAMETERSENTRY._serialized_start = 905 + _MODELMETADATARESPONSE_TENSORMETADATA_PARAMETERSENTRY._serialized_end = 981 + _MODELMETADATARESPONSE_PARAMETERSENTRY._serialized_start = 905 + _MODELMETADATARESPONSE_PARAMETERSENTRY._serialized_end = 981 + _MODELINFERREQUEST._serialized_start = 1062 + _MODELINFERREQUEST._serialized_end = 1940 + _MODELINFERREQUEST_INFERINPUTTENSOR._serialized_start = 1370 + _MODELINFERREQUEST_INFERINPUTTENSOR._serialized_end = 1646 + _MODELINFERREQUEST_INFERINPUTTENSOR_PARAMETERSENTRY._serialized_start = 905 + _MODELINFERREQUEST_INFERINPUTTENSOR_PARAMETERSENTRY._serialized_end = 981 + _MODELINFERREQUEST_INFERREQUESTEDOUTPUTTENSOR._serialized_start = 1649 + _MODELINFERREQUEST_INFERREQUESTEDOUTPUTTENSOR._serialized_end = 1862 + _MODELINFERREQUEST_INFERREQUESTEDOUTPUTTENSOR_PARAMETERSENTRY._serialized_start = ( + 905 ) - _globals["_MODELINFERREQUEST_INFERREQUESTEDOUTPUTTENSOR"]._serialized_start = 1663 - _globals["_MODELINFERREQUEST_INFERREQUESTEDOUTPUTTENSOR"]._serialized_end = 1876 - _globals[ - "_MODELINFERREQUEST_INFERREQUESTEDOUTPUTTENSOR_PARAMETERSENTRY" - ]._serialized_start = 919 - _globals[ - "_MODELINFERREQUEST_INFERREQUESTEDOUTPUTTENSOR_PARAMETERSENTRY" - ]._serialized_end = 995 - _globals["_MODELINFERREQUEST_PARAMETERSENTRY"]._serialized_start = 919 - _globals["_MODELINFERREQUEST_PARAMETERSENTRY"]._serialized_end = 995 - _globals["_MODELINFERRESPONSE"]._serialized_start = 1957 - _globals["_MODELINFERRESPONSE"]._serialized_end = 2554 - _globals["_MODELINFERRESPONSE_INFEROUTPUTTENSOR"]._serialized_start = 2197 - _globals["_MODELINFERRESPONSE_INFEROUTPUTTENSOR"]._serialized_end = 2476 - _globals[ - "_MODELINFERRESPONSE_INFEROUTPUTTENSOR_PARAMETERSENTRY" - ]._serialized_start = 919 - _globals[ - "_MODELINFERRESPONSE_INFEROUTPUTTENSOR_PARAMETERSENTRY" - ]._serialized_end = 995 - _globals["_MODELINFERRESPONSE_PARAMETERSENTRY"]._serialized_start = 919 - _globals["_MODELINFERRESPONSE_PARAMETERSENTRY"]._serialized_end = 995 - _globals["_INFERPARAMETER"]._serialized_start = 2556 - _globals["_INFERPARAMETER"]._serialized_end = 2661 - _globals["_INFERTENSORCONTENTS"]._serialized_start = 2664 - _globals["_INFERTENSORCONTENTS"]._serialized_end = 2872 - _globals["_MODELREPOSITORYPARAMETER"]._serialized_start = 2875 - _globals["_MODELREPOSITORYPARAMETER"]._serialized_end = 3013 - _globals["_REPOSITORYINDEXREQUEST"]._serialized_start = 3015 - _globals["_REPOSITORYINDEXREQUEST"]._serialized_end = 3079 - _globals["_REPOSITORYINDEXRESPONSE"]._serialized_start = 3082 - _globals["_REPOSITORYINDEXRESPONSE"]._serialized_end = 3246 - _globals["_REPOSITORYINDEXRESPONSE_MODELINDEX"]._serialized_start = 3172 - _globals["_REPOSITORYINDEXRESPONSE_MODELINDEX"]._serialized_end = 3246 - _globals["_REPOSITORYMODELLOADREQUEST"]._serialized_start = 3249 - _globals["_REPOSITORYMODELLOADREQUEST"]._serialized_end = 3485 - _globals["_REPOSITORYMODELLOADREQUEST_PARAMETERSENTRY"]._serialized_start = 3399 - _globals["_REPOSITORYMODELLOADREQUEST_PARAMETERSENTRY"]._serialized_end = 3485 - _globals["_REPOSITORYMODELLOADRESPONSE"]._serialized_start = 3487 - _globals["_REPOSITORYMODELLOADRESPONSE"]._serialized_end = 3516 - _globals["_REPOSITORYMODELUNLOADREQUEST"]._serialized_start = 3519 - _globals["_REPOSITORYMODELUNLOADREQUEST"]._serialized_end = 3759 - _globals["_REPOSITORYMODELUNLOADREQUEST_PARAMETERSENTRY"]._serialized_start = 3399 - _globals["_REPOSITORYMODELUNLOADREQUEST_PARAMETERSENTRY"]._serialized_end = 3485 - _globals["_REPOSITORYMODELUNLOADRESPONSE"]._serialized_start = 3761 - _globals["_REPOSITORYMODELUNLOADRESPONSE"]._serialized_end = 3792 - _globals["_GRPCINFERENCESERVICE"]._serialized_start = 3795 - _globals["_GRPCINFERENCESERVICE"]._serialized_end = 4696 + _MODELINFERREQUEST_INFERREQUESTEDOUTPUTTENSOR_PARAMETERSENTRY._serialized_end = 981 + _MODELINFERREQUEST_PARAMETERSENTRY._serialized_start = 905 + _MODELINFERREQUEST_PARAMETERSENTRY._serialized_end = 981 + _MODELINFERRESPONSE._serialized_start = 1943 + _MODELINFERRESPONSE._serialized_end = 2540 + _MODELINFERRESPONSE_INFEROUTPUTTENSOR._serialized_start = 2183 + _MODELINFERRESPONSE_INFEROUTPUTTENSOR._serialized_end = 2462 + _MODELINFERRESPONSE_INFEROUTPUTTENSOR_PARAMETERSENTRY._serialized_start = 905 + _MODELINFERRESPONSE_INFEROUTPUTTENSOR_PARAMETERSENTRY._serialized_end = 981 + _MODELINFERRESPONSE_PARAMETERSENTRY._serialized_start = 905 + _MODELINFERRESPONSE_PARAMETERSENTRY._serialized_end = 981 + _INFERPARAMETER._serialized_start = 2542 + _INFERPARAMETER._serialized_end = 2647 + _INFERTENSORCONTENTS._serialized_start = 2650 + _INFERTENSORCONTENTS._serialized_end = 2858 + _MODELREPOSITORYPARAMETER._serialized_start = 2861 + _MODELREPOSITORYPARAMETER._serialized_end = 2999 + _REPOSITORYINDEXREQUEST._serialized_start = 3001 + _REPOSITORYINDEXREQUEST._serialized_end = 3065 + _REPOSITORYINDEXRESPONSE._serialized_start = 3068 + _REPOSITORYINDEXRESPONSE._serialized_end = 3232 + _REPOSITORYINDEXRESPONSE_MODELINDEX._serialized_start = 3158 + _REPOSITORYINDEXRESPONSE_MODELINDEX._serialized_end = 3232 + _REPOSITORYMODELLOADREQUEST._serialized_start = 3235 + _REPOSITORYMODELLOADREQUEST._serialized_end = 3471 + _REPOSITORYMODELLOADREQUEST_PARAMETERSENTRY._serialized_start = 3385 + _REPOSITORYMODELLOADREQUEST_PARAMETERSENTRY._serialized_end = 3471 + _REPOSITORYMODELLOADRESPONSE._serialized_start = 3473 + _REPOSITORYMODELLOADRESPONSE._serialized_end = 3502 + _REPOSITORYMODELUNLOADREQUEST._serialized_start = 3505 + _REPOSITORYMODELUNLOADREQUEST._serialized_end = 3745 + _REPOSITORYMODELUNLOADREQUEST_PARAMETERSENTRY._serialized_start = 3385 + _REPOSITORYMODELUNLOADREQUEST_PARAMETERSENTRY._serialized_end = 3471 + _REPOSITORYMODELUNLOADRESPONSE._serialized_start = 3747 + _REPOSITORYMODELUNLOADRESPONSE._serialized_end = 3778 + _GRPCINFERENCESERVICE._serialized_start = 3781 + _GRPCINFERENCESERVICE._serialized_end = 4682 # @@protoc_insertion_point(module_scope) diff --git a/mlserver/grpc/dataplane_pb2.pyi b/mlserver/grpc/dataplane_pb2.pyi index 9df1a1d6c..0cc3d750e 100644 --- a/mlserver/grpc/dataplane_pb2.pyi +++ b/mlserver/grpc/dataplane_pb2.pyi @@ -1,544 +1,1448 @@ -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from typing import ( - ClassVar as _ClassVar, - Iterable as _Iterable, - Mapping as _Mapping, - Optional as _Optional, - Union as _Union, -) - -DESCRIPTOR: _descriptor.FileDescriptor - -class HelloRequest(_message.Message): - __slots__ = ("name", "num_greetings") - NAME_FIELD_NUMBER: _ClassVar[int] - NUM_GREETINGS_FIELD_NUMBER: _ClassVar[int] - name: str - num_greetings: str +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" + +import builtins +import google.protobuf.descriptor +import google.protobuf.internal.containers +import google.protobuf.message +import typing +import typing_extensions + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ... + +class HelloRequest(google.protobuf.message.Message): + """The request message containing the user's name and how many greetings + they want. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + NAME_FIELD_NUMBER: builtins.int + NUM_GREETINGS_FIELD_NUMBER: builtins.int + name: typing.Text = ... + num_greetings: typing.Text = ... + def __init__( + self, + *, + name: typing.Text = ..., + num_greetings: typing.Text = ..., + ) -> None: ... + def ClearField( + self, + field_name: typing_extensions.Literal[ + "name", b"name", "num_greetings", b"num_greetings" + ], + ) -> None: ... + +global___HelloRequest = HelloRequest + +class HelloReply(google.protobuf.message.Message): + """A response message containing a greeting""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + MESSAGE_FIELD_NUMBER: builtins.int + message: typing.Text = ... def __init__( - self, name: _Optional[str] = ..., num_greetings: _Optional[str] = ... - ) -> None: ... - -class HelloReply(_message.Message): - __slots__ = ("message",) - MESSAGE_FIELD_NUMBER: _ClassVar[int] - message: str - def __init__(self, message: _Optional[str] = ...) -> None: ... - -class ServerLiveRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class ServerLiveResponse(_message.Message): - __slots__ = ("live",) - LIVE_FIELD_NUMBER: _ClassVar[int] - live: bool - def __init__(self, live: bool = ...) -> None: ... - -class ServerReadyRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class ServerReadyResponse(_message.Message): - __slots__ = ("ready",) - READY_FIELD_NUMBER: _ClassVar[int] - ready: bool - def __init__(self, ready: bool = ...) -> None: ... - -class ModelReadyRequest(_message.Message): - __slots__ = ("name", "version") - NAME_FIELD_NUMBER: _ClassVar[int] - VERSION_FIELD_NUMBER: _ClassVar[int] - name: str - version: str + self, + *, + message: typing.Text = ..., + ) -> None: ... + def ClearField( + self, field_name: typing_extensions.Literal["message", b"message"] + ) -> None: ... + +global___HelloReply = HelloReply + +class ServerLiveRequest(google.protobuf.message.Message): + """ + ServerLive messages. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... def __init__( - self, name: _Optional[str] = ..., version: _Optional[str] = ... - ) -> None: ... - -class ModelReadyResponse(_message.Message): - __slots__ = ("ready",) - READY_FIELD_NUMBER: _ClassVar[int] - ready: bool - def __init__(self, ready: bool = ...) -> None: ... - -class ServerMetadataRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class ServerMetadataResponse(_message.Message): - __slots__ = ("name", "version", "extensions") - NAME_FIELD_NUMBER: _ClassVar[int] - VERSION_FIELD_NUMBER: _ClassVar[int] - EXTENSIONS_FIELD_NUMBER: _ClassVar[int] - name: str - version: str - extensions: _containers.RepeatedScalarFieldContainer[str] + self, + ) -> None: ... + +global___ServerLiveRequest = ServerLiveRequest + +class ServerLiveResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + LIVE_FIELD_NUMBER: builtins.int + live: builtins.bool = ... + """True if the inference server is live, false if not live.""" + + def __init__( + self, + *, + live: builtins.bool = ..., + ) -> None: ... + def ClearField( + self, field_name: typing_extensions.Literal["live", b"live"] + ) -> None: ... + +global___ServerLiveResponse = ServerLiveResponse + +class ServerReadyRequest(google.protobuf.message.Message): + """ + ServerReady messages. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + def __init__( + self, + ) -> None: ... + +global___ServerReadyRequest = ServerReadyRequest + +class ServerReadyResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + READY_FIELD_NUMBER: builtins.int + ready: builtins.bool = ... + """True if the inference server is ready, false if not ready.""" + + def __init__( + self, + *, + ready: builtins.bool = ..., + ) -> None: ... + def ClearField( + self, field_name: typing_extensions.Literal["ready", b"ready"] + ) -> None: ... + +global___ServerReadyResponse = ServerReadyResponse + +class ModelReadyRequest(google.protobuf.message.Message): + """ + ModelReady messages. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + NAME_FIELD_NUMBER: builtins.int + VERSION_FIELD_NUMBER: builtins.int + name: typing.Text = ... + """The name of the model to check for readiness.""" + + version: typing.Text = ... + """The version of the model to check for readiness. If not given the + server will choose a version based on the model and internal policy. + """ + + def __init__( + self, + *, + name: typing.Text = ..., + version: typing.Text = ..., + ) -> None: ... + def ClearField( + self, + field_name: typing_extensions.Literal["name", b"name", "version", b"version"], + ) -> None: ... + +global___ModelReadyRequest = ModelReadyRequest + +class ModelReadyResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + READY_FIELD_NUMBER: builtins.int + ready: builtins.bool = ... + """True if the model is ready, false if not ready.""" + + def __init__( + self, + *, + ready: builtins.bool = ..., + ) -> None: ... + def ClearField( + self, field_name: typing_extensions.Literal["ready", b"ready"] + ) -> None: ... + +global___ModelReadyResponse = ModelReadyResponse + +class ServerMetadataRequest(google.protobuf.message.Message): + """ + ServerMetadata messages. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + def __init__( + self, + ) -> None: ... + +global___ServerMetadataRequest = ServerMetadataRequest + +class ServerMetadataResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + NAME_FIELD_NUMBER: builtins.int + VERSION_FIELD_NUMBER: builtins.int + EXTENSIONS_FIELD_NUMBER: builtins.int + name: typing.Text = ... + """The server name.""" + + version: typing.Text = ... + """The server version.""" + + @property + def extensions( + self, + ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: + """The extensions supported by the server.""" + pass + def __init__( self, - name: _Optional[str] = ..., - version: _Optional[str] = ..., - extensions: _Optional[_Iterable[str]] = ..., + *, + name: typing.Text = ..., + version: typing.Text = ..., + extensions: typing.Optional[typing.Iterable[typing.Text]] = ..., ) -> None: ... + def ClearField( + self, + field_name: typing_extensions.Literal[ + "extensions", b"extensions", "name", b"name", "version", b"version" + ], + ) -> None: ... + +global___ServerMetadataResponse = ServerMetadataResponse + +class ModelMetadataRequest(google.protobuf.message.Message): + """ + ModelMetadata messages. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + NAME_FIELD_NUMBER: builtins.int + VERSION_FIELD_NUMBER: builtins.int + name: typing.Text = ... + """The name of the model.""" + + version: typing.Text = ... + """The version of the model to check for readiness. If not given the + server will choose a version based on the model and internal policy. + """ -class ModelMetadataRequest(_message.Message): - __slots__ = ("name", "version") - NAME_FIELD_NUMBER: _ClassVar[int] - VERSION_FIELD_NUMBER: _ClassVar[int] - name: str - version: str def __init__( - self, name: _Optional[str] = ..., version: _Optional[str] = ... + self, + *, + name: typing.Text = ..., + version: typing.Text = ..., + ) -> None: ... + def ClearField( + self, + field_name: typing_extensions.Literal["name", b"name", "version", b"version"], ) -> None: ... -class ModelMetadataResponse(_message.Message): - __slots__ = ("name", "versions", "platform", "inputs", "outputs", "parameters") +global___ModelMetadataRequest = ModelMetadataRequest - class TensorMetadata(_message.Message): - __slots__ = ("name", "datatype", "shape", "parameters") +class ModelMetadataResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... - class ParametersEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: InferParameter + class TensorMetadata(google.protobuf.message.Message): + """Metadata for a tensor.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + + class ParametersEntry(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + KEY_FIELD_NUMBER: builtins.int + VALUE_FIELD_NUMBER: builtins.int + key: typing.Text = ... + @property + def value(self) -> global___InferParameter: ... def __init__( self, - key: _Optional[str] = ..., - value: _Optional[_Union[InferParameter, _Mapping]] = ..., + *, + key: typing.Text = ..., + value: typing.Optional[global___InferParameter] = ..., ) -> None: ... + def HasField( + self, field_name: typing_extensions.Literal["value", b"value"] + ) -> builtins.bool: ... + def ClearField( + self, + field_name: typing_extensions.Literal["key", b"key", "value", b"value"], + ) -> None: ... + + NAME_FIELD_NUMBER: builtins.int + DATATYPE_FIELD_NUMBER: builtins.int + SHAPE_FIELD_NUMBER: builtins.int + PARAMETERS_FIELD_NUMBER: builtins.int + name: typing.Text = ... + """The tensor name.""" + + datatype: typing.Text = ... + """The tensor data type.""" + + @property + def shape( + self, + ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[ + builtins.int + ]: + """The tensor shape. A variable-size dimension is represented + by a -1 value. + """ + pass + + @property + def parameters( + self, + ) -> google.protobuf.internal.containers.MessageMap[ + typing.Text, global___InferParameter + ]: + """Optional default parameters for input. + NOTE: This is an extension to the standard + """ + pass - NAME_FIELD_NUMBER: _ClassVar[int] - DATATYPE_FIELD_NUMBER: _ClassVar[int] - SHAPE_FIELD_NUMBER: _ClassVar[int] - PARAMETERS_FIELD_NUMBER: _ClassVar[int] - name: str - datatype: str - shape: _containers.RepeatedScalarFieldContainer[int] - parameters: _containers.MessageMap[str, InferParameter] def __init__( self, - name: _Optional[str] = ..., - datatype: _Optional[str] = ..., - shape: _Optional[_Iterable[int]] = ..., - parameters: _Optional[_Mapping[str, InferParameter]] = ..., + *, + name: typing.Text = ..., + datatype: typing.Text = ..., + shape: typing.Optional[typing.Iterable[builtins.int]] = ..., + parameters: typing.Optional[ + typing.Mapping[typing.Text, global___InferParameter] + ] = ..., + ) -> None: ... + def ClearField( + self, + field_name: typing_extensions.Literal[ + "datatype", + b"datatype", + "name", + b"name", + "parameters", + b"parameters", + "shape", + b"shape", + ], ) -> None: ... - class ParametersEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: InferParameter + class ParametersEntry(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + KEY_FIELD_NUMBER: builtins.int + VALUE_FIELD_NUMBER: builtins.int + key: typing.Text = ... + @property + def value(self) -> global___InferParameter: ... def __init__( self, - key: _Optional[str] = ..., - value: _Optional[_Union[InferParameter, _Mapping]] = ..., + *, + key: typing.Text = ..., + value: typing.Optional[global___InferParameter] = ..., + ) -> None: ... + def HasField( + self, field_name: typing_extensions.Literal["value", b"value"] + ) -> builtins.bool: ... + def ClearField( + self, + field_name: typing_extensions.Literal["key", b"key", "value", b"value"], ) -> None: ... - NAME_FIELD_NUMBER: _ClassVar[int] - VERSIONS_FIELD_NUMBER: _ClassVar[int] - PLATFORM_FIELD_NUMBER: _ClassVar[int] - INPUTS_FIELD_NUMBER: _ClassVar[int] - OUTPUTS_FIELD_NUMBER: _ClassVar[int] - PARAMETERS_FIELD_NUMBER: _ClassVar[int] - name: str - versions: _containers.RepeatedScalarFieldContainer[str] - platform: str - inputs: _containers.RepeatedCompositeFieldContainer[ - ModelMetadataResponse.TensorMetadata - ] - outputs: _containers.RepeatedCompositeFieldContainer[ - ModelMetadataResponse.TensorMetadata - ] - parameters: _containers.MessageMap[str, InferParameter] + NAME_FIELD_NUMBER: builtins.int + VERSIONS_FIELD_NUMBER: builtins.int + PLATFORM_FIELD_NUMBER: builtins.int + INPUTS_FIELD_NUMBER: builtins.int + OUTPUTS_FIELD_NUMBER: builtins.int + PARAMETERS_FIELD_NUMBER: builtins.int + name: typing.Text = ... + """The model name.""" + + @property + def versions( + self, + ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: + """The versions of the model available on the server.""" + pass + platform: typing.Text = ... + """The model's platform. See Platforms.""" + + @property + def inputs( + self, + ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[ + global___ModelMetadataResponse.TensorMetadata + ]: + """The model's inputs.""" + pass + + @property + def outputs( + self, + ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[ + global___ModelMetadataResponse.TensorMetadata + ]: + """The model's outputs.""" + pass + + @property + def parameters( + self, + ) -> google.protobuf.internal.containers.MessageMap[ + typing.Text, global___InferParameter + ]: + """Optional default parameters for the request / response. + NOTE: This is an extension to the standard + """ + pass + def __init__( self, - name: _Optional[str] = ..., - versions: _Optional[_Iterable[str]] = ..., - platform: _Optional[str] = ..., - inputs: _Optional[ - _Iterable[_Union[ModelMetadataResponse.TensorMetadata, _Mapping]] + *, + name: typing.Text = ..., + versions: typing.Optional[typing.Iterable[typing.Text]] = ..., + platform: typing.Text = ..., + inputs: typing.Optional[ + typing.Iterable[global___ModelMetadataResponse.TensorMetadata] + ] = ..., + outputs: typing.Optional[ + typing.Iterable[global___ModelMetadataResponse.TensorMetadata] ] = ..., - outputs: _Optional[ - _Iterable[_Union[ModelMetadataResponse.TensorMetadata, _Mapping]] + parameters: typing.Optional[ + typing.Mapping[typing.Text, global___InferParameter] ] = ..., - parameters: _Optional[_Mapping[str, InferParameter]] = ..., - ) -> None: ... - -class ModelInferRequest(_message.Message): - __slots__ = ( - "model_name", - "model_version", - "id", - "parameters", - "inputs", - "outputs", - "raw_input_contents", - ) - - class InferInputTensor(_message.Message): - __slots__ = ("name", "datatype", "shape", "parameters", "contents") - - class ParametersEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: InferParameter + ) -> None: ... + def ClearField( + self, + field_name: typing_extensions.Literal[ + "inputs", + b"inputs", + "name", + b"name", + "outputs", + b"outputs", + "parameters", + b"parameters", + "platform", + b"platform", + "versions", + b"versions", + ], + ) -> None: ... + +global___ModelMetadataResponse = ModelMetadataResponse + +class ModelInferRequest(google.protobuf.message.Message): + """ + ModelInfer messages. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + + class InferInputTensor(google.protobuf.message.Message): + """An input tensor for an inference request.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + + class ParametersEntry(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + KEY_FIELD_NUMBER: builtins.int + VALUE_FIELD_NUMBER: builtins.int + key: typing.Text = ... + @property + def value(self) -> global___InferParameter: ... def __init__( self, - key: _Optional[str] = ..., - value: _Optional[_Union[InferParameter, _Mapping]] = ..., + *, + key: typing.Text = ..., + value: typing.Optional[global___InferParameter] = ..., + ) -> None: ... + def HasField( + self, field_name: typing_extensions.Literal["value", b"value"] + ) -> builtins.bool: ... + def ClearField( + self, + field_name: typing_extensions.Literal["key", b"key", "value", b"value"], ) -> None: ... - NAME_FIELD_NUMBER: _ClassVar[int] - DATATYPE_FIELD_NUMBER: _ClassVar[int] - SHAPE_FIELD_NUMBER: _ClassVar[int] - PARAMETERS_FIELD_NUMBER: _ClassVar[int] - CONTENTS_FIELD_NUMBER: _ClassVar[int] - name: str - datatype: str - shape: _containers.RepeatedScalarFieldContainer[int] - parameters: _containers.MessageMap[str, InferParameter] - contents: InferTensorContents + NAME_FIELD_NUMBER: builtins.int + DATATYPE_FIELD_NUMBER: builtins.int + SHAPE_FIELD_NUMBER: builtins.int + PARAMETERS_FIELD_NUMBER: builtins.int + CONTENTS_FIELD_NUMBER: builtins.int + name: typing.Text = ... + """The tensor name.""" + + datatype: typing.Text = ... + """The tensor data type.""" + + @property + def shape( + self, + ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[ + builtins.int + ]: + """The tensor shape.""" + pass + + @property + def parameters( + self, + ) -> google.protobuf.internal.containers.MessageMap[ + typing.Text, global___InferParameter + ]: + """Optional inference input tensor parameters.""" + pass + + @property + def contents(self) -> global___InferTensorContents: + """The input tensor data. + This field must not be specified if tensor contents are being specified + in ModelInferRequest.raw_input_contents. + """ + pass + def __init__( self, - name: _Optional[str] = ..., - datatype: _Optional[str] = ..., - shape: _Optional[_Iterable[int]] = ..., - parameters: _Optional[_Mapping[str, InferParameter]] = ..., - contents: _Optional[_Union[InferTensorContents, _Mapping]] = ..., + *, + name: typing.Text = ..., + datatype: typing.Text = ..., + shape: typing.Optional[typing.Iterable[builtins.int]] = ..., + parameters: typing.Optional[ + typing.Mapping[typing.Text, global___InferParameter] + ] = ..., + contents: typing.Optional[global___InferTensorContents] = ..., + ) -> None: ... + def HasField( + self, field_name: typing_extensions.Literal["contents", b"contents"] + ) -> builtins.bool: ... + def ClearField( + self, + field_name: typing_extensions.Literal[ + "contents", + b"contents", + "datatype", + b"datatype", + "name", + b"name", + "parameters", + b"parameters", + "shape", + b"shape", + ], ) -> None: ... - class InferRequestedOutputTensor(_message.Message): - __slots__ = ("name", "parameters") + class InferRequestedOutputTensor(google.protobuf.message.Message): + """An output tensor requested for an inference request.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... - class ParametersEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: InferParameter + class ParametersEntry(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + KEY_FIELD_NUMBER: builtins.int + VALUE_FIELD_NUMBER: builtins.int + key: typing.Text = ... + @property + def value(self) -> global___InferParameter: ... def __init__( self, - key: _Optional[str] = ..., - value: _Optional[_Union[InferParameter, _Mapping]] = ..., + *, + key: typing.Text = ..., + value: typing.Optional[global___InferParameter] = ..., ) -> None: ... + def HasField( + self, field_name: typing_extensions.Literal["value", b"value"] + ) -> builtins.bool: ... + def ClearField( + self, + field_name: typing_extensions.Literal["key", b"key", "value", b"value"], + ) -> None: ... + + NAME_FIELD_NUMBER: builtins.int + PARAMETERS_FIELD_NUMBER: builtins.int + name: typing.Text = ... + """The tensor name.""" + + @property + def parameters( + self, + ) -> google.protobuf.internal.containers.MessageMap[ + typing.Text, global___InferParameter + ]: + """Optional requested output tensor parameters.""" + pass - NAME_FIELD_NUMBER: _ClassVar[int] - PARAMETERS_FIELD_NUMBER: _ClassVar[int] - name: str - parameters: _containers.MessageMap[str, InferParameter] def __init__( self, - name: _Optional[str] = ..., - parameters: _Optional[_Mapping[str, InferParameter]] = ..., + *, + name: typing.Text = ..., + parameters: typing.Optional[ + typing.Mapping[typing.Text, global___InferParameter] + ] = ..., + ) -> None: ... + def ClearField( + self, + field_name: typing_extensions.Literal[ + "name", b"name", "parameters", b"parameters" + ], ) -> None: ... - class ParametersEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: InferParameter + class ParametersEntry(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + KEY_FIELD_NUMBER: builtins.int + VALUE_FIELD_NUMBER: builtins.int + key: typing.Text = ... + @property + def value(self) -> global___InferParameter: ... def __init__( self, - key: _Optional[str] = ..., - value: _Optional[_Union[InferParameter, _Mapping]] = ..., + *, + key: typing.Text = ..., + value: typing.Optional[global___InferParameter] = ..., ) -> None: ... + def HasField( + self, field_name: typing_extensions.Literal["value", b"value"] + ) -> builtins.bool: ... + def ClearField( + self, + field_name: typing_extensions.Literal["key", b"key", "value", b"value"], + ) -> None: ... + + MODEL_NAME_FIELD_NUMBER: builtins.int + MODEL_VERSION_FIELD_NUMBER: builtins.int + ID_FIELD_NUMBER: builtins.int + PARAMETERS_FIELD_NUMBER: builtins.int + INPUTS_FIELD_NUMBER: builtins.int + OUTPUTS_FIELD_NUMBER: builtins.int + RAW_INPUT_CONTENTS_FIELD_NUMBER: builtins.int + model_name: typing.Text = ... + """The name of the model to use for inferencing.""" + + model_version: typing.Text = ... + """The version of the model to use for inference. If not given the + server will choose a version based on the model and internal policy. + """ + + id: typing.Text = ... + """Optional identifier for the request. If specified will be + returned in the response. + """ + + @property + def parameters( + self, + ) -> google.protobuf.internal.containers.MessageMap[ + typing.Text, global___InferParameter + ]: + """Optional inference parameters.""" + pass + + @property + def inputs( + self, + ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[ + global___ModelInferRequest.InferInputTensor + ]: + """The input tensors for the inference.""" + pass + + @property + def outputs( + self, + ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[ + global___ModelInferRequest.InferRequestedOutputTensor + ]: + """The requested output tensors for the inference. Optional, if not + specified all outputs produced by the model will be returned. + """ + pass + + @property + def raw_input_contents( + self, + ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[ + builtins.bytes + ]: + """The data contained in an input tensor can be represented in "raw" bytes + form or in the repeated type that matches the tensor's data type. Using + the "raw" bytes form will typically allow higher performance due to the + way protobuf allocation and reuse interacts with GRPC. For example, see + https://github.com/grpc/grpc/issues/23231. + + To use the raw representation 'raw_input_contents' must be initialized + with data for each tensor in the same order as 'inputs'. For each tensor, + the size of this content must match what is expected by the tensor's shape + and data type. The raw data must be the flattened, one-dimensional, + row-major order of the tensor elements without any stride or padding + between the elements. Note that the FP16 and BF16 data types must be + represented as raw content as there is no specific data type for a 16-bit + float type. + + If this field is specified then InferInputTensor::contents must not be + specified for any input tensor. + """ + pass - MODEL_NAME_FIELD_NUMBER: _ClassVar[int] - MODEL_VERSION_FIELD_NUMBER: _ClassVar[int] - ID_FIELD_NUMBER: _ClassVar[int] - PARAMETERS_FIELD_NUMBER: _ClassVar[int] - INPUTS_FIELD_NUMBER: _ClassVar[int] - OUTPUTS_FIELD_NUMBER: _ClassVar[int] - RAW_INPUT_CONTENTS_FIELD_NUMBER: _ClassVar[int] - model_name: str - model_version: str - id: str - parameters: _containers.MessageMap[str, InferParameter] - inputs: _containers.RepeatedCompositeFieldContainer[ - ModelInferRequest.InferInputTensor - ] - outputs: _containers.RepeatedCompositeFieldContainer[ - ModelInferRequest.InferRequestedOutputTensor - ] - raw_input_contents: _containers.RepeatedScalarFieldContainer[bytes] def __init__( self, - model_name: _Optional[str] = ..., - model_version: _Optional[str] = ..., - id: _Optional[str] = ..., - parameters: _Optional[_Mapping[str, InferParameter]] = ..., - inputs: _Optional[ - _Iterable[_Union[ModelInferRequest.InferInputTensor, _Mapping]] + *, + model_name: typing.Text = ..., + model_version: typing.Text = ..., + id: typing.Text = ..., + parameters: typing.Optional[ + typing.Mapping[typing.Text, global___InferParameter] ] = ..., - outputs: _Optional[ - _Iterable[_Union[ModelInferRequest.InferRequestedOutputTensor, _Mapping]] + inputs: typing.Optional[ + typing.Iterable[global___ModelInferRequest.InferInputTensor] ] = ..., - raw_input_contents: _Optional[_Iterable[bytes]] = ..., - ) -> None: ... - -class ModelInferResponse(_message.Message): - __slots__ = ( - "model_name", - "model_version", - "id", - "parameters", - "outputs", - "raw_output_contents", - ) - - class InferOutputTensor(_message.Message): - __slots__ = ("name", "datatype", "shape", "parameters", "contents") - - class ParametersEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: InferParameter + outputs: typing.Optional[ + typing.Iterable[global___ModelInferRequest.InferRequestedOutputTensor] + ] = ..., + raw_input_contents: typing.Optional[typing.Iterable[builtins.bytes]] = ..., + ) -> None: ... + def ClearField( + self, + field_name: typing_extensions.Literal[ + "id", + b"id", + "inputs", + b"inputs", + "model_name", + b"model_name", + "model_version", + b"model_version", + "outputs", + b"outputs", + "parameters", + b"parameters", + "raw_input_contents", + b"raw_input_contents", + ], + ) -> None: ... + +global___ModelInferRequest = ModelInferRequest + +class ModelInferResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + + class InferOutputTensor(google.protobuf.message.Message): + """An output tensor returned for an inference request.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + + class ParametersEntry(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + KEY_FIELD_NUMBER: builtins.int + VALUE_FIELD_NUMBER: builtins.int + key: typing.Text = ... + @property + def value(self) -> global___InferParameter: ... def __init__( self, - key: _Optional[str] = ..., - value: _Optional[_Union[InferParameter, _Mapping]] = ..., + *, + key: typing.Text = ..., + value: typing.Optional[global___InferParameter] = ..., + ) -> None: ... + def HasField( + self, field_name: typing_extensions.Literal["value", b"value"] + ) -> builtins.bool: ... + def ClearField( + self, + field_name: typing_extensions.Literal["key", b"key", "value", b"value"], ) -> None: ... - NAME_FIELD_NUMBER: _ClassVar[int] - DATATYPE_FIELD_NUMBER: _ClassVar[int] - SHAPE_FIELD_NUMBER: _ClassVar[int] - PARAMETERS_FIELD_NUMBER: _ClassVar[int] - CONTENTS_FIELD_NUMBER: _ClassVar[int] - name: str - datatype: str - shape: _containers.RepeatedScalarFieldContainer[int] - parameters: _containers.MessageMap[str, InferParameter] - contents: InferTensorContents + NAME_FIELD_NUMBER: builtins.int + DATATYPE_FIELD_NUMBER: builtins.int + SHAPE_FIELD_NUMBER: builtins.int + PARAMETERS_FIELD_NUMBER: builtins.int + CONTENTS_FIELD_NUMBER: builtins.int + name: typing.Text = ... + """The tensor name.""" + + datatype: typing.Text = ... + """The tensor data type.""" + + @property + def shape( + self, + ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[ + builtins.int + ]: + """The tensor shape.""" + pass + + @property + def parameters( + self, + ) -> google.protobuf.internal.containers.MessageMap[ + typing.Text, global___InferParameter + ]: + """Optional output tensor parameters.""" + pass + + @property + def contents(self) -> global___InferTensorContents: + """The output tensor data. + This field must not be specified if tensor contents are being specified + in ModelInferResponse.raw_output_contents. + """ + pass + def __init__( self, - name: _Optional[str] = ..., - datatype: _Optional[str] = ..., - shape: _Optional[_Iterable[int]] = ..., - parameters: _Optional[_Mapping[str, InferParameter]] = ..., - contents: _Optional[_Union[InferTensorContents, _Mapping]] = ..., + *, + name: typing.Text = ..., + datatype: typing.Text = ..., + shape: typing.Optional[typing.Iterable[builtins.int]] = ..., + parameters: typing.Optional[ + typing.Mapping[typing.Text, global___InferParameter] + ] = ..., + contents: typing.Optional[global___InferTensorContents] = ..., + ) -> None: ... + def HasField( + self, field_name: typing_extensions.Literal["contents", b"contents"] + ) -> builtins.bool: ... + def ClearField( + self, + field_name: typing_extensions.Literal[ + "contents", + b"contents", + "datatype", + b"datatype", + "name", + b"name", + "parameters", + b"parameters", + "shape", + b"shape", + ], ) -> None: ... - class ParametersEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: InferParameter + class ParametersEntry(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + KEY_FIELD_NUMBER: builtins.int + VALUE_FIELD_NUMBER: builtins.int + key: typing.Text = ... + @property + def value(self) -> global___InferParameter: ... def __init__( self, - key: _Optional[str] = ..., - value: _Optional[_Union[InferParameter, _Mapping]] = ..., + *, + key: typing.Text = ..., + value: typing.Optional[global___InferParameter] = ..., ) -> None: ... + def HasField( + self, field_name: typing_extensions.Literal["value", b"value"] + ) -> builtins.bool: ... + def ClearField( + self, + field_name: typing_extensions.Literal["key", b"key", "value", b"value"], + ) -> None: ... + + MODEL_NAME_FIELD_NUMBER: builtins.int + MODEL_VERSION_FIELD_NUMBER: builtins.int + ID_FIELD_NUMBER: builtins.int + PARAMETERS_FIELD_NUMBER: builtins.int + OUTPUTS_FIELD_NUMBER: builtins.int + RAW_OUTPUT_CONTENTS_FIELD_NUMBER: builtins.int + model_name: typing.Text = ... + """The name of the model used for inference.""" + + model_version: typing.Text = ... + """The version of the model used for inference.""" + + id: typing.Text = ... + """The id of the inference request if one was specified.""" + + @property + def parameters( + self, + ) -> google.protobuf.internal.containers.MessageMap[ + typing.Text, global___InferParameter + ]: + """Optional inference response parameters.""" + pass + + @property + def outputs( + self, + ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[ + global___ModelInferResponse.InferOutputTensor + ]: + """The output tensors holding inference results.""" + pass + + @property + def raw_output_contents( + self, + ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[ + builtins.bytes + ]: + """The data contained in an output tensor can be represented in "raw" bytes + form or in the repeated type that matches the tensor's data type. Using + the "raw" bytes form will typically allow higher performance due to the + way protobuf allocation and reuse interacts with GRPC. For example, see + https://github.com/grpc/grpc/issues/23231. + + To use the raw representation 'raw_output_contents' must be initialized + with data for each tensor in the same order as 'outputs'. For each tensor, + the size of this content must match what is expected by the tensor's shape + and data type. The raw data must be the flattened, one-dimensional, + row-major order of the tensor elements without any stride or padding + between the elements. Note that the FP16 and BF16 data types must be + represented as raw content as there is no specific data type for a 16-bit + float type. + + If this field is specified then InferOutputTensor::contents must not be + specified for any output tensor. + """ + pass - MODEL_NAME_FIELD_NUMBER: _ClassVar[int] - MODEL_VERSION_FIELD_NUMBER: _ClassVar[int] - ID_FIELD_NUMBER: _ClassVar[int] - PARAMETERS_FIELD_NUMBER: _ClassVar[int] - OUTPUTS_FIELD_NUMBER: _ClassVar[int] - RAW_OUTPUT_CONTENTS_FIELD_NUMBER: _ClassVar[int] - model_name: str - model_version: str - id: str - parameters: _containers.MessageMap[str, InferParameter] - outputs: _containers.RepeatedCompositeFieldContainer[ - ModelInferResponse.InferOutputTensor - ] - raw_output_contents: _containers.RepeatedScalarFieldContainer[bytes] def __init__( self, - model_name: _Optional[str] = ..., - model_version: _Optional[str] = ..., - id: _Optional[str] = ..., - parameters: _Optional[_Mapping[str, InferParameter]] = ..., - outputs: _Optional[ - _Iterable[_Union[ModelInferResponse.InferOutputTensor, _Mapping]] + *, + model_name: typing.Text = ..., + model_version: typing.Text = ..., + id: typing.Text = ..., + parameters: typing.Optional[ + typing.Mapping[typing.Text, global___InferParameter] ] = ..., - raw_output_contents: _Optional[_Iterable[bytes]] = ..., + outputs: typing.Optional[ + typing.Iterable[global___ModelInferResponse.InferOutputTensor] + ] = ..., + raw_output_contents: typing.Optional[typing.Iterable[builtins.bytes]] = ..., + ) -> None: ... + def ClearField( + self, + field_name: typing_extensions.Literal[ + "id", + b"id", + "model_name", + b"model_name", + "model_version", + b"model_version", + "outputs", + b"outputs", + "parameters", + b"parameters", + "raw_output_contents", + b"raw_output_contents", + ], ) -> None: ... -class InferParameter(_message.Message): - __slots__ = ("bool_param", "int64_param", "string_param") - BOOL_PARAM_FIELD_NUMBER: _ClassVar[int] - INT64_PARAM_FIELD_NUMBER: _ClassVar[int] - STRING_PARAM_FIELD_NUMBER: _ClassVar[int] - bool_param: bool - int64_param: int - string_param: str +global___ModelInferResponse = ModelInferResponse + +class InferParameter(google.protobuf.message.Message): + """ + An inference parameter value. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + BOOL_PARAM_FIELD_NUMBER: builtins.int + INT64_PARAM_FIELD_NUMBER: builtins.int + STRING_PARAM_FIELD_NUMBER: builtins.int + bool_param: builtins.bool = ... + """A boolean parameter value.""" + + int64_param: builtins.int = ... + """An int64 parameter value.""" + + string_param: typing.Text = ... + """A string parameter value.""" + def __init__( self, - bool_param: bool = ..., - int64_param: _Optional[int] = ..., - string_param: _Optional[str] = ..., - ) -> None: ... - -class InferTensorContents(_message.Message): - __slots__ = ( - "bool_contents", - "int_contents", - "int64_contents", - "uint_contents", - "uint64_contents", - "fp32_contents", - "fp64_contents", - "bytes_contents", - ) - BOOL_CONTENTS_FIELD_NUMBER: _ClassVar[int] - INT_CONTENTS_FIELD_NUMBER: _ClassVar[int] - INT64_CONTENTS_FIELD_NUMBER: _ClassVar[int] - UINT_CONTENTS_FIELD_NUMBER: _ClassVar[int] - UINT64_CONTENTS_FIELD_NUMBER: _ClassVar[int] - FP32_CONTENTS_FIELD_NUMBER: _ClassVar[int] - FP64_CONTENTS_FIELD_NUMBER: _ClassVar[int] - BYTES_CONTENTS_FIELD_NUMBER: _ClassVar[int] - bool_contents: _containers.RepeatedScalarFieldContainer[bool] - int_contents: _containers.RepeatedScalarFieldContainer[int] - int64_contents: _containers.RepeatedScalarFieldContainer[int] - uint_contents: _containers.RepeatedScalarFieldContainer[int] - uint64_contents: _containers.RepeatedScalarFieldContainer[int] - fp32_contents: _containers.RepeatedScalarFieldContainer[float] - fp64_contents: _containers.RepeatedScalarFieldContainer[float] - bytes_contents: _containers.RepeatedScalarFieldContainer[bytes] + *, + bool_param: builtins.bool = ..., + int64_param: builtins.int = ..., + string_param: typing.Text = ..., + ) -> None: ... + def HasField( + self, + field_name: typing_extensions.Literal[ + "bool_param", + b"bool_param", + "int64_param", + b"int64_param", + "parameter_choice", + b"parameter_choice", + "string_param", + b"string_param", + ], + ) -> builtins.bool: ... + def ClearField( + self, + field_name: typing_extensions.Literal[ + "bool_param", + b"bool_param", + "int64_param", + b"int64_param", + "parameter_choice", + b"parameter_choice", + "string_param", + b"string_param", + ], + ) -> None: ... + def WhichOneof( + self, + oneof_group: typing_extensions.Literal["parameter_choice", b"parameter_choice"], + ) -> typing.Optional[ + typing_extensions.Literal["bool_param", "int64_param", "string_param"] + ]: ... + +global___InferParameter = InferParameter + +class InferTensorContents(google.protobuf.message.Message): + """ + The data contained in a tensor. For a given data type the + tensor contents can be represented in "raw" bytes form or in + the repeated type that matches the tensor's data type. Protobuf + oneof is not used because oneofs cannot contain repeated fields. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + BOOL_CONTENTS_FIELD_NUMBER: builtins.int + INT_CONTENTS_FIELD_NUMBER: builtins.int + INT64_CONTENTS_FIELD_NUMBER: builtins.int + UINT_CONTENTS_FIELD_NUMBER: builtins.int + UINT64_CONTENTS_FIELD_NUMBER: builtins.int + FP32_CONTENTS_FIELD_NUMBER: builtins.int + FP64_CONTENTS_FIELD_NUMBER: builtins.int + BYTES_CONTENTS_FIELD_NUMBER: builtins.int + @property + def bool_contents( + self, + ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[ + builtins.bool + ]: + """Representation for BOOL data type. The size must match what is + expected by the tensor's shape. The contents must be the flattened, + one-dimensional, row-major order of the tensor elements. + """ + pass + + @property + def int_contents( + self, + ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: + """Representation for INT8, INT16, and INT32 data types. The size + must match what is expected by the tensor's shape. The contents + must be the flattened, one-dimensional, row-major order of the + tensor elements. + """ + pass + + @property + def int64_contents( + self, + ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: + """Representation for INT64 data types. The size must match what + is expected by the tensor's shape. The contents must be the + flattened, one-dimensional, row-major order of the tensor elements. + """ + pass + + @property + def uint_contents( + self, + ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: + """Representation for UINT8, UINT16, and UINT32 data types. The size + must match what is expected by the tensor's shape. The contents + must be the flattened, one-dimensional, row-major order of the + tensor elements. + """ + pass + + @property + def uint64_contents( + self, + ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: + """Representation for UINT64 data types. The size must match what + is expected by the tensor's shape. The contents must be the + flattened, one-dimensional, row-major order of the tensor elements. + """ + pass + + @property + def fp32_contents( + self, + ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[ + builtins.float + ]: + """Representation for FP32 data type. The size must match what is + expected by the tensor's shape. The contents must be the flattened, + one-dimensional, row-major order of the tensor elements. + """ + pass + + @property + def fp64_contents( + self, + ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[ + builtins.float + ]: + """Representation for FP64 data type. The size must match what is + expected by the tensor's shape. The contents must be the flattened, + one-dimensional, row-major order of the tensor elements. + """ + pass + + @property + def bytes_contents( + self, + ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[ + builtins.bytes + ]: + """Representation for BYTES data type. The size must match what is + expected by the tensor's shape. The contents must be the flattened, + one-dimensional, row-major order of the tensor elements. + """ + pass + def __init__( self, - bool_contents: _Optional[_Iterable[bool]] = ..., - int_contents: _Optional[_Iterable[int]] = ..., - int64_contents: _Optional[_Iterable[int]] = ..., - uint_contents: _Optional[_Iterable[int]] = ..., - uint64_contents: _Optional[_Iterable[int]] = ..., - fp32_contents: _Optional[_Iterable[float]] = ..., - fp64_contents: _Optional[_Iterable[float]] = ..., - bytes_contents: _Optional[_Iterable[bytes]] = ..., - ) -> None: ... - -class ModelRepositoryParameter(_message.Message): - __slots__ = ("bool_param", "int64_param", "string_param", "bytes_param") - BOOL_PARAM_FIELD_NUMBER: _ClassVar[int] - INT64_PARAM_FIELD_NUMBER: _ClassVar[int] - STRING_PARAM_FIELD_NUMBER: _ClassVar[int] - BYTES_PARAM_FIELD_NUMBER: _ClassVar[int] - bool_param: bool - int64_param: int - string_param: str - bytes_param: bytes + *, + bool_contents: typing.Optional[typing.Iterable[builtins.bool]] = ..., + int_contents: typing.Optional[typing.Iterable[builtins.int]] = ..., + int64_contents: typing.Optional[typing.Iterable[builtins.int]] = ..., + uint_contents: typing.Optional[typing.Iterable[builtins.int]] = ..., + uint64_contents: typing.Optional[typing.Iterable[builtins.int]] = ..., + fp32_contents: typing.Optional[typing.Iterable[builtins.float]] = ..., + fp64_contents: typing.Optional[typing.Iterable[builtins.float]] = ..., + bytes_contents: typing.Optional[typing.Iterable[builtins.bytes]] = ..., + ) -> None: ... + def ClearField( + self, + field_name: typing_extensions.Literal[ + "bool_contents", + b"bool_contents", + "bytes_contents", + b"bytes_contents", + "fp32_contents", + b"fp32_contents", + "fp64_contents", + b"fp64_contents", + "int64_contents", + b"int64_contents", + "int_contents", + b"int_contents", + "uint64_contents", + b"uint64_contents", + "uint_contents", + b"uint_contents", + ], + ) -> None: ... + +global___InferTensorContents = InferTensorContents + +class ModelRepositoryParameter(google.protobuf.message.Message): + """ + Messages for the Repository API + + NOTE: These messages used to exist previously on a different protobuf + definition. However, they have now been merged with the main + GRPCInferenceService. + + An model repository parameter value. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + BOOL_PARAM_FIELD_NUMBER: builtins.int + INT64_PARAM_FIELD_NUMBER: builtins.int + STRING_PARAM_FIELD_NUMBER: builtins.int + BYTES_PARAM_FIELD_NUMBER: builtins.int + bool_param: builtins.bool = ... + """A boolean parameter value.""" + + int64_param: builtins.int = ... + """An int64 parameter value.""" + + string_param: typing.Text = ... + """A string parameter value.""" + + bytes_param: builtins.bytes = ... + """A bytes parameter value.""" + def __init__( self, - bool_param: bool = ..., - int64_param: _Optional[int] = ..., - string_param: _Optional[str] = ..., - bytes_param: _Optional[bytes] = ..., + *, + bool_param: builtins.bool = ..., + int64_param: builtins.int = ..., + string_param: typing.Text = ..., + bytes_param: builtins.bytes = ..., + ) -> None: ... + def HasField( + self, + field_name: typing_extensions.Literal[ + "bool_param", + b"bool_param", + "bytes_param", + b"bytes_param", + "int64_param", + b"int64_param", + "parameter_choice", + b"parameter_choice", + "string_param", + b"string_param", + ], + ) -> builtins.bool: ... + def ClearField( + self, + field_name: typing_extensions.Literal[ + "bool_param", + b"bool_param", + "bytes_param", + b"bytes_param", + "int64_param", + b"int64_param", + "parameter_choice", + b"parameter_choice", + "string_param", + b"string_param", + ], ) -> None: ... + def WhichOneof( + self, + oneof_group: typing_extensions.Literal["parameter_choice", b"parameter_choice"], + ) -> typing.Optional[ + typing_extensions.Literal[ + "bool_param", "int64_param", "string_param", "bytes_param" + ] + ]: ... + +global___ModelRepositoryParameter = ModelRepositoryParameter + +class RepositoryIndexRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + REPOSITORY_NAME_FIELD_NUMBER: builtins.int + READY_FIELD_NUMBER: builtins.int + repository_name: typing.Text = ... + """The name of the repository. If empty the index is returned + for all repositories. + """ + + ready: builtins.bool = ... + """If true return only models currently ready for inferencing.""" -class RepositoryIndexRequest(_message.Message): - __slots__ = ("repository_name", "ready") - REPOSITORY_NAME_FIELD_NUMBER: _ClassVar[int] - READY_FIELD_NUMBER: _ClassVar[int] - repository_name: str - ready: bool def __init__( - self, repository_name: _Optional[str] = ..., ready: bool = ... - ) -> None: ... - -class RepositoryIndexResponse(_message.Message): - __slots__ = ("models",) - - class ModelIndex(_message.Message): - __slots__ = ("name", "version", "state", "reason") - NAME_FIELD_NUMBER: _ClassVar[int] - VERSION_FIELD_NUMBER: _ClassVar[int] - STATE_FIELD_NUMBER: _ClassVar[int] - REASON_FIELD_NUMBER: _ClassVar[int] - name: str - version: str - state: str - reason: str + self, + *, + repository_name: typing.Text = ..., + ready: builtins.bool = ..., + ) -> None: ... + def ClearField( + self, + field_name: typing_extensions.Literal[ + "ready", b"ready", "repository_name", b"repository_name" + ], + ) -> None: ... + +global___RepositoryIndexRequest = RepositoryIndexRequest + +class RepositoryIndexResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + + class ModelIndex(google.protobuf.message.Message): + """Index entry for a model.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + NAME_FIELD_NUMBER: builtins.int + VERSION_FIELD_NUMBER: builtins.int + STATE_FIELD_NUMBER: builtins.int + REASON_FIELD_NUMBER: builtins.int + name: typing.Text = ... + """The name of the model.""" + + version: typing.Text = ... + """The version of the model.""" + + state: typing.Text = ... + """The state of the model.""" + + reason: typing.Text = ... + """The reason, if any, that the model is in the given state.""" + def __init__( self, - name: _Optional[str] = ..., - version: _Optional[str] = ..., - state: _Optional[str] = ..., - reason: _Optional[str] = ..., + *, + name: typing.Text = ..., + version: typing.Text = ..., + state: typing.Text = ..., + reason: typing.Text = ..., + ) -> None: ... + def ClearField( + self, + field_name: typing_extensions.Literal[ + "name", + b"name", + "reason", + b"reason", + "state", + b"state", + "version", + b"version", + ], ) -> None: ... - MODELS_FIELD_NUMBER: _ClassVar[int] - models: _containers.RepeatedCompositeFieldContainer[ - RepositoryIndexResponse.ModelIndex - ] + MODELS_FIELD_NUMBER: builtins.int + @property + def models( + self, + ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[ + global___RepositoryIndexResponse.ModelIndex + ]: + """An index entry for each model.""" + pass + def __init__( self, - models: _Optional[ - _Iterable[_Union[RepositoryIndexResponse.ModelIndex, _Mapping]] + *, + models: typing.Optional[ + typing.Iterable[global___RepositoryIndexResponse.ModelIndex] ] = ..., ) -> None: ... + def ClearField( + self, field_name: typing_extensions.Literal["models", b"models"] + ) -> None: ... -class RepositoryModelLoadRequest(_message.Message): - __slots__ = ("repository_name", "model_name", "parameters") +global___RepositoryIndexResponse = RepositoryIndexResponse - class ParametersEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: ModelRepositoryParameter +class RepositoryModelLoadRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + + class ParametersEntry(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + KEY_FIELD_NUMBER: builtins.int + VALUE_FIELD_NUMBER: builtins.int + key: typing.Text = ... + @property + def value(self) -> global___ModelRepositoryParameter: ... def __init__( self, - key: _Optional[str] = ..., - value: _Optional[_Union[ModelRepositoryParameter, _Mapping]] = ..., + *, + key: typing.Text = ..., + value: typing.Optional[global___ModelRepositoryParameter] = ..., + ) -> None: ... + def HasField( + self, field_name: typing_extensions.Literal["value", b"value"] + ) -> builtins.bool: ... + def ClearField( + self, + field_name: typing_extensions.Literal["key", b"key", "value", b"value"], ) -> None: ... - REPOSITORY_NAME_FIELD_NUMBER: _ClassVar[int] - MODEL_NAME_FIELD_NUMBER: _ClassVar[int] - PARAMETERS_FIELD_NUMBER: _ClassVar[int] - repository_name: str - model_name: str - parameters: _containers.MessageMap[str, ModelRepositoryParameter] + REPOSITORY_NAME_FIELD_NUMBER: builtins.int + MODEL_NAME_FIELD_NUMBER: builtins.int + PARAMETERS_FIELD_NUMBER: builtins.int + repository_name: typing.Text = ... + """The name of the repository to load from. If empty the model + is loaded from any repository. + """ + + model_name: typing.Text = ... + """The name of the model to load, or reload.""" + + @property + def parameters( + self, + ) -> google.protobuf.internal.containers.MessageMap[ + typing.Text, global___ModelRepositoryParameter + ]: + """Optional model repository request parameters.""" + pass + + def __init__( + self, + *, + repository_name: typing.Text = ..., + model_name: typing.Text = ..., + parameters: typing.Optional[ + typing.Mapping[typing.Text, global___ModelRepositoryParameter] + ] = ..., + ) -> None: ... + def ClearField( + self, + field_name: typing_extensions.Literal[ + "model_name", + b"model_name", + "parameters", + b"parameters", + "repository_name", + b"repository_name", + ], + ) -> None: ... + +global___RepositoryModelLoadRequest = RepositoryModelLoadRequest + +class RepositoryModelLoadResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... def __init__( self, - repository_name: _Optional[str] = ..., - model_name: _Optional[str] = ..., - parameters: _Optional[_Mapping[str, ModelRepositoryParameter]] = ..., ) -> None: ... -class RepositoryModelLoadResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... +global___RepositoryModelLoadResponse = RepositoryModelLoadResponse -class RepositoryModelUnloadRequest(_message.Message): - __slots__ = ("repository_name", "model_name", "parameters") +class RepositoryModelUnloadRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... - class ParametersEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: ModelRepositoryParameter + class ParametersEntry(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... + KEY_FIELD_NUMBER: builtins.int + VALUE_FIELD_NUMBER: builtins.int + key: typing.Text = ... + @property + def value(self) -> global___ModelRepositoryParameter: ... def __init__( self, - key: _Optional[str] = ..., - value: _Optional[_Union[ModelRepositoryParameter, _Mapping]] = ..., + *, + key: typing.Text = ..., + value: typing.Optional[global___ModelRepositoryParameter] = ..., + ) -> None: ... + def HasField( + self, field_name: typing_extensions.Literal["value", b"value"] + ) -> builtins.bool: ... + def ClearField( + self, + field_name: typing_extensions.Literal["key", b"key", "value", b"value"], ) -> None: ... - REPOSITORY_NAME_FIELD_NUMBER: _ClassVar[int] - MODEL_NAME_FIELD_NUMBER: _ClassVar[int] - PARAMETERS_FIELD_NUMBER: _ClassVar[int] - repository_name: str - model_name: str - parameters: _containers.MessageMap[str, ModelRepositoryParameter] + REPOSITORY_NAME_FIELD_NUMBER: builtins.int + MODEL_NAME_FIELD_NUMBER: builtins.int + PARAMETERS_FIELD_NUMBER: builtins.int + repository_name: typing.Text = ... + """The name of the repository from which the model was originally + loaded. If empty the repository is not considered. + """ + + model_name: typing.Text = ... + """The name of the model to unload.""" + + @property + def parameters( + self, + ) -> google.protobuf.internal.containers.MessageMap[ + typing.Text, global___ModelRepositoryParameter + ]: + """Optional model repository request parameters.""" + pass + + def __init__( + self, + *, + repository_name: typing.Text = ..., + model_name: typing.Text = ..., + parameters: typing.Optional[ + typing.Mapping[typing.Text, global___ModelRepositoryParameter] + ] = ..., + ) -> None: ... + def ClearField( + self, + field_name: typing_extensions.Literal[ + "model_name", + b"model_name", + "parameters", + b"parameters", + "repository_name", + b"repository_name", + ], + ) -> None: ... + +global___RepositoryModelUnloadRequest = RepositoryModelUnloadRequest + +class RepositoryModelUnloadResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor = ... def __init__( self, - repository_name: _Optional[str] = ..., - model_name: _Optional[str] = ..., - parameters: _Optional[_Mapping[str, ModelRepositoryParameter]] = ..., ) -> None: ... -class RepositoryModelUnloadResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... +global___RepositoryModelUnloadResponse = RepositoryModelUnloadResponse diff --git a/mlserver/grpc/dataplane_pb2_grpc.py b/mlserver/grpc/dataplane_pb2_grpc.py index 5f9d9187e..266d34de7 100644 --- a/mlserver/grpc/dataplane_pb2_grpc.py +++ b/mlserver/grpc/dataplane_pb2_grpc.py @@ -2,7 +2,7 @@ """Client and server classes corresponding to protobuf-defined services.""" import grpc -from mlserver.grpc import dataplane_pb2 as mlserver_dot_grpc_dot_dataplane__pb2 +from . import dataplane_pb2 as dataplane__pb2 class GRPCInferenceServiceStub(object): @@ -19,53 +19,53 @@ def __init__(self, channel): """ self.ServerLive = channel.unary_unary( "/inference.GRPCInferenceService/ServerLive", - request_serializer=mlserver_dot_grpc_dot_dataplane__pb2.ServerLiveRequest.SerializeToString, - response_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.ServerLiveResponse.FromString, + request_serializer=dataplane__pb2.ServerLiveRequest.SerializeToString, + response_deserializer=dataplane__pb2.ServerLiveResponse.FromString, ) self.ServerReady = channel.unary_unary( "/inference.GRPCInferenceService/ServerReady", - request_serializer=mlserver_dot_grpc_dot_dataplane__pb2.ServerReadyRequest.SerializeToString, - response_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.ServerReadyResponse.FromString, + request_serializer=dataplane__pb2.ServerReadyRequest.SerializeToString, + response_deserializer=dataplane__pb2.ServerReadyResponse.FromString, ) self.ModelReady = channel.unary_unary( "/inference.GRPCInferenceService/ModelReady", - request_serializer=mlserver_dot_grpc_dot_dataplane__pb2.ModelReadyRequest.SerializeToString, - response_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.ModelReadyResponse.FromString, + request_serializer=dataplane__pb2.ModelReadyRequest.SerializeToString, + response_deserializer=dataplane__pb2.ModelReadyResponse.FromString, ) self.ServerMetadata = channel.unary_unary( "/inference.GRPCInferenceService/ServerMetadata", - request_serializer=mlserver_dot_grpc_dot_dataplane__pb2.ServerMetadataRequest.SerializeToString, - response_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.ServerMetadataResponse.FromString, + request_serializer=dataplane__pb2.ServerMetadataRequest.SerializeToString, + response_deserializer=dataplane__pb2.ServerMetadataResponse.FromString, ) self.ModelMetadata = channel.unary_unary( "/inference.GRPCInferenceService/ModelMetadata", - request_serializer=mlserver_dot_grpc_dot_dataplane__pb2.ModelMetadataRequest.SerializeToString, - response_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.ModelMetadataResponse.FromString, + request_serializer=dataplane__pb2.ModelMetadataRequest.SerializeToString, + response_deserializer=dataplane__pb2.ModelMetadataResponse.FromString, ) self.ModelInfer = channel.unary_unary( "/inference.GRPCInferenceService/ModelInfer", - request_serializer=mlserver_dot_grpc_dot_dataplane__pb2.ModelInferRequest.SerializeToString, - response_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.ModelInferResponse.FromString, + request_serializer=dataplane__pb2.ModelInferRequest.SerializeToString, + response_deserializer=dataplane__pb2.ModelInferResponse.FromString, ) self.ModelStreamInfer = channel.stream_stream( "/inference.GRPCInferenceService/ModelStreamInfer", - request_serializer=mlserver_dot_grpc_dot_dataplane__pb2.ModelInferRequest.SerializeToString, - response_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.ModelInferResponse.FromString, + request_serializer=dataplane__pb2.ModelInferRequest.SerializeToString, + response_deserializer=dataplane__pb2.ModelInferResponse.FromString, ) self.RepositoryIndex = channel.unary_unary( "/inference.GRPCInferenceService/RepositoryIndex", - request_serializer=mlserver_dot_grpc_dot_dataplane__pb2.RepositoryIndexRequest.SerializeToString, - response_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.RepositoryIndexResponse.FromString, + request_serializer=dataplane__pb2.RepositoryIndexRequest.SerializeToString, + response_deserializer=dataplane__pb2.RepositoryIndexResponse.FromString, ) self.RepositoryModelLoad = channel.unary_unary( "/inference.GRPCInferenceService/RepositoryModelLoad", - request_serializer=mlserver_dot_grpc_dot_dataplane__pb2.RepositoryModelLoadRequest.SerializeToString, - response_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.RepositoryModelLoadResponse.FromString, + request_serializer=dataplane__pb2.RepositoryModelLoadRequest.SerializeToString, + response_deserializer=dataplane__pb2.RepositoryModelLoadResponse.FromString, ) self.RepositoryModelUnload = channel.unary_unary( "/inference.GRPCInferenceService/RepositoryModelUnload", - request_serializer=mlserver_dot_grpc_dot_dataplane__pb2.RepositoryModelUnloadRequest.SerializeToString, - response_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.RepositoryModelUnloadResponse.FromString, + request_serializer=dataplane__pb2.RepositoryModelUnloadRequest.SerializeToString, + response_deserializer=dataplane__pb2.RepositoryModelUnloadResponse.FromString, ) @@ -140,53 +140,53 @@ def add_GRPCInferenceServiceServicer_to_server(servicer, server): rpc_method_handlers = { "ServerLive": grpc.unary_unary_rpc_method_handler( servicer.ServerLive, - request_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.ServerLiveRequest.FromString, - response_serializer=mlserver_dot_grpc_dot_dataplane__pb2.ServerLiveResponse.SerializeToString, + request_deserializer=dataplane__pb2.ServerLiveRequest.FromString, + response_serializer=dataplane__pb2.ServerLiveResponse.SerializeToString, ), "ServerReady": grpc.unary_unary_rpc_method_handler( servicer.ServerReady, - request_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.ServerReadyRequest.FromString, - response_serializer=mlserver_dot_grpc_dot_dataplane__pb2.ServerReadyResponse.SerializeToString, + request_deserializer=dataplane__pb2.ServerReadyRequest.FromString, + response_serializer=dataplane__pb2.ServerReadyResponse.SerializeToString, ), "ModelReady": grpc.unary_unary_rpc_method_handler( servicer.ModelReady, - request_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.ModelReadyRequest.FromString, - response_serializer=mlserver_dot_grpc_dot_dataplane__pb2.ModelReadyResponse.SerializeToString, + request_deserializer=dataplane__pb2.ModelReadyRequest.FromString, + response_serializer=dataplane__pb2.ModelReadyResponse.SerializeToString, ), "ServerMetadata": grpc.unary_unary_rpc_method_handler( servicer.ServerMetadata, - request_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.ServerMetadataRequest.FromString, - response_serializer=mlserver_dot_grpc_dot_dataplane__pb2.ServerMetadataResponse.SerializeToString, + request_deserializer=dataplane__pb2.ServerMetadataRequest.FromString, + response_serializer=dataplane__pb2.ServerMetadataResponse.SerializeToString, ), "ModelMetadata": grpc.unary_unary_rpc_method_handler( servicer.ModelMetadata, - request_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.ModelMetadataRequest.FromString, - response_serializer=mlserver_dot_grpc_dot_dataplane__pb2.ModelMetadataResponse.SerializeToString, + request_deserializer=dataplane__pb2.ModelMetadataRequest.FromString, + response_serializer=dataplane__pb2.ModelMetadataResponse.SerializeToString, ), "ModelInfer": grpc.unary_unary_rpc_method_handler( servicer.ModelInfer, - request_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.ModelInferRequest.FromString, - response_serializer=mlserver_dot_grpc_dot_dataplane__pb2.ModelInferResponse.SerializeToString, + request_deserializer=dataplane__pb2.ModelInferRequest.FromString, + response_serializer=dataplane__pb2.ModelInferResponse.SerializeToString, ), "ModelStreamInfer": grpc.stream_stream_rpc_method_handler( servicer.ModelStreamInfer, - request_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.ModelInferRequest.FromString, - response_serializer=mlserver_dot_grpc_dot_dataplane__pb2.ModelInferResponse.SerializeToString, + request_deserializer=dataplane__pb2.ModelInferRequest.FromString, + response_serializer=dataplane__pb2.ModelInferResponse.SerializeToString, ), "RepositoryIndex": grpc.unary_unary_rpc_method_handler( servicer.RepositoryIndex, - request_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.RepositoryIndexRequest.FromString, - response_serializer=mlserver_dot_grpc_dot_dataplane__pb2.RepositoryIndexResponse.SerializeToString, + request_deserializer=dataplane__pb2.RepositoryIndexRequest.FromString, + response_serializer=dataplane__pb2.RepositoryIndexResponse.SerializeToString, ), "RepositoryModelLoad": grpc.unary_unary_rpc_method_handler( servicer.RepositoryModelLoad, - request_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.RepositoryModelLoadRequest.FromString, - response_serializer=mlserver_dot_grpc_dot_dataplane__pb2.RepositoryModelLoadResponse.SerializeToString, + request_deserializer=dataplane__pb2.RepositoryModelLoadRequest.FromString, + response_serializer=dataplane__pb2.RepositoryModelLoadResponse.SerializeToString, ), "RepositoryModelUnload": grpc.unary_unary_rpc_method_handler( servicer.RepositoryModelUnload, - request_deserializer=mlserver_dot_grpc_dot_dataplane__pb2.RepositoryModelUnloadRequest.FromString, - response_serializer=mlserver_dot_grpc_dot_dataplane__pb2.RepositoryModelUnloadResponse.SerializeToString, + request_deserializer=dataplane__pb2.RepositoryModelUnloadRequest.FromString, + response_serializer=dataplane__pb2.RepositoryModelUnloadResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( @@ -219,8 +219,8 @@ def ServerLive( request, target, "/inference.GRPCInferenceService/ServerLive", - mlserver_dot_grpc_dot_dataplane__pb2.ServerLiveRequest.SerializeToString, - mlserver_dot_grpc_dot_dataplane__pb2.ServerLiveResponse.FromString, + dataplane__pb2.ServerLiveRequest.SerializeToString, + dataplane__pb2.ServerLiveResponse.FromString, options, channel_credentials, insecure, @@ -248,8 +248,8 @@ def ServerReady( request, target, "/inference.GRPCInferenceService/ServerReady", - mlserver_dot_grpc_dot_dataplane__pb2.ServerReadyRequest.SerializeToString, - mlserver_dot_grpc_dot_dataplane__pb2.ServerReadyResponse.FromString, + dataplane__pb2.ServerReadyRequest.SerializeToString, + dataplane__pb2.ServerReadyResponse.FromString, options, channel_credentials, insecure, @@ -277,8 +277,8 @@ def ModelReady( request, target, "/inference.GRPCInferenceService/ModelReady", - mlserver_dot_grpc_dot_dataplane__pb2.ModelReadyRequest.SerializeToString, - mlserver_dot_grpc_dot_dataplane__pb2.ModelReadyResponse.FromString, + dataplane__pb2.ModelReadyRequest.SerializeToString, + dataplane__pb2.ModelReadyResponse.FromString, options, channel_credentials, insecure, @@ -306,8 +306,8 @@ def ServerMetadata( request, target, "/inference.GRPCInferenceService/ServerMetadata", - mlserver_dot_grpc_dot_dataplane__pb2.ServerMetadataRequest.SerializeToString, - mlserver_dot_grpc_dot_dataplane__pb2.ServerMetadataResponse.FromString, + dataplane__pb2.ServerMetadataRequest.SerializeToString, + dataplane__pb2.ServerMetadataResponse.FromString, options, channel_credentials, insecure, @@ -335,8 +335,8 @@ def ModelMetadata( request, target, "/inference.GRPCInferenceService/ModelMetadata", - mlserver_dot_grpc_dot_dataplane__pb2.ModelMetadataRequest.SerializeToString, - mlserver_dot_grpc_dot_dataplane__pb2.ModelMetadataResponse.FromString, + dataplane__pb2.ModelMetadataRequest.SerializeToString, + dataplane__pb2.ModelMetadataResponse.FromString, options, channel_credentials, insecure, @@ -364,8 +364,8 @@ def ModelInfer( request, target, "/inference.GRPCInferenceService/ModelInfer", - mlserver_dot_grpc_dot_dataplane__pb2.ModelInferRequest.SerializeToString, - mlserver_dot_grpc_dot_dataplane__pb2.ModelInferResponse.FromString, + dataplane__pb2.ModelInferRequest.SerializeToString, + dataplane__pb2.ModelInferResponse.FromString, options, channel_credentials, insecure, @@ -393,8 +393,8 @@ def ModelStreamInfer( request_iterator, target, "/inference.GRPCInferenceService/ModelStreamInfer", - mlserver_dot_grpc_dot_dataplane__pb2.ModelInferRequest.SerializeToString, - mlserver_dot_grpc_dot_dataplane__pb2.ModelInferResponse.FromString, + dataplane__pb2.ModelInferRequest.SerializeToString, + dataplane__pb2.ModelInferResponse.FromString, options, channel_credentials, insecure, @@ -422,8 +422,8 @@ def RepositoryIndex( request, target, "/inference.GRPCInferenceService/RepositoryIndex", - mlserver_dot_grpc_dot_dataplane__pb2.RepositoryIndexRequest.SerializeToString, - mlserver_dot_grpc_dot_dataplane__pb2.RepositoryIndexResponse.FromString, + dataplane__pb2.RepositoryIndexRequest.SerializeToString, + dataplane__pb2.RepositoryIndexResponse.FromString, options, channel_credentials, insecure, @@ -451,8 +451,8 @@ def RepositoryModelLoad( request, target, "/inference.GRPCInferenceService/RepositoryModelLoad", - mlserver_dot_grpc_dot_dataplane__pb2.RepositoryModelLoadRequest.SerializeToString, - mlserver_dot_grpc_dot_dataplane__pb2.RepositoryModelLoadResponse.FromString, + dataplane__pb2.RepositoryModelLoadRequest.SerializeToString, + dataplane__pb2.RepositoryModelLoadResponse.FromString, options, channel_credentials, insecure, @@ -480,8 +480,8 @@ def RepositoryModelUnload( request, target, "/inference.GRPCInferenceService/RepositoryModelUnload", - mlserver_dot_grpc_dot_dataplane__pb2.RepositoryModelUnloadRequest.SerializeToString, - mlserver_dot_grpc_dot_dataplane__pb2.RepositoryModelUnloadResponse.FromString, + dataplane__pb2.RepositoryModelUnloadRequest.SerializeToString, + dataplane__pb2.RepositoryModelUnloadResponse.FromString, options, channel_credentials, insecure, diff --git a/mlserver/grpc/servicers.py b/mlserver/grpc/servicers.py index e52953349..d918b65a0 100644 --- a/mlserver/grpc/servicers.py +++ b/mlserver/grpc/servicers.py @@ -15,7 +15,7 @@ from ..utils import insert_headers, extract_headers from ..handlers import DataPlane, ModelRepositoryHandlers from ..types import InferenceResponse -from typing import AsyncIterator, Any, Optional, List +from typing import AsyncIterator class InferenceServicer(GRPCInferenceServiceServicer): diff --git a/mlserver/handlers/dataplane.py b/mlserver/handlers/dataplane.py index 76e23c038..a776c514f 100644 --- a/mlserver/handlers/dataplane.py +++ b/mlserver/handlers/dataplane.py @@ -3,7 +3,7 @@ Counter, Summary, ) -from typing import Any, AsyncIterator, Coroutine, Optional, Dict, List +from typing import AsyncIterator, Optional from ..model import MLModel from ..errors import ModelNotReady diff --git a/mlserver/rest/endpoints.py b/mlserver/rest/endpoints.py index 1315cdab8..94e8fc6fd 100644 --- a/mlserver/rest/endpoints.py +++ b/mlserver/rest/endpoints.py @@ -1,9 +1,8 @@ from fastapi.requests import Request from fastapi.responses import Response, HTMLResponse, StreamingResponse from fastapi.openapi.docs import get_swagger_ui_html -from sse_starlette.sse import EventSourceResponse -from typing import Any, AsyncIterator, Coroutine, Optional, Union +from typing import AsyncIterator, Optional from ..types import ( MetadataModelResponse, @@ -137,14 +136,14 @@ async def payloads_async_iter( async def _as_sse( infer_stream: AsyncIterator[InferenceResponse], -) -> AsyncIterator[ServerSentEvent]: +) -> AsyncIterator[bytes]: """ Helper to convert all the responses coming out of a generator to a Server-Sent Event object. """ async for inference_response in infer_stream: # TODO: How should we send headers back? - response_headers = extract_headers(inference_response) + # response_headers = extract_headers(inference_response) yield ServerSentEvent(inference_response).encode() diff --git a/mlserver/rest/responses.py b/mlserver/rest/responses.py index 5f19b7b0c..7005ac237 100644 --- a/mlserver/rest/responses.py +++ b/mlserver/rest/responses.py @@ -1,11 +1,11 @@ import json -from typing import Any, AsyncIterator +from typing import Any from pydantic import BaseModel from starlette.responses import JSONResponse as _JSONResponse -from ..codecs.string import encode_str, decode_str +from ..codecs.string import decode_str try: import orjson diff --git a/tests/fixtures.py b/tests/fixtures.py index ee097621b..a5c19a7e1 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -23,7 +23,7 @@ ResponseOutput, Parameters, ) -from mlserver.codecs import NumpyRequestCodec, NumpyCodec, decode_args, StringCodec +from mlserver.codecs import NumpyCodec, decode_args, StringCodec from mlserver.handlers.custom import custom_handler from mlserver.errors import MLServerError diff --git a/tests/test_settings.py b/tests/test_settings.py index 98fe904c5..dbd9cae5c 100644 --- a/tests/test_settings.py +++ b/tests/test_settings.py @@ -96,6 +96,6 @@ def test_model_settings_serialisation(): def test_model_settings_streaming(caplog): with pytest.raises(ValueError) as err: - settings = Settings(parallel_workers=2, streaming_enabled=True) + _ = Settings(parallel_workers=2, streaming_enabled=True) assert "Streaming is not supported with `parallel_workers' > 0" in str(err.value)