|
| 1 | +# Copyright 2016 Google Inc. All Rights Reserved. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | +# ============================================================================== |
| 15 | +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! |
| 16 | +# source: tensorflow_serving/apis/prediction_service.proto |
| 17 | +# To regenerate run |
| 18 | +# python -m grpc.tools.protoc --python_out=. --grpc_python_out=. -I. tensorflow_serving/apis/prediction_service.proto |
| 19 | +import grpc |
| 20 | + |
| 21 | +from tensorflow_serving.apis import classification_pb2 as tensorflow__serving_dot_apis_dot_classification__pb2 |
| 22 | +from tensorflow_serving.apis import get_model_metadata_pb2 as tensorflow__serving_dot_apis_dot_get__model__metadata__pb2 |
| 23 | +from tensorflow_serving.apis import inference_pb2 as tensorflow__serving_dot_apis_dot_inference__pb2 |
| 24 | +from tensorflow_serving.apis import predict_pb2 as tensorflow__serving_dot_apis_dot_predict__pb2 |
| 25 | +from tensorflow_serving.apis import regression_pb2 as tensorflow__serving_dot_apis_dot_regression__pb2 |
| 26 | + |
| 27 | + |
| 28 | +class PredictionServiceStub(object): |
| 29 | + """open source marker; do not remove |
| 30 | + PredictionService provides access to machine-learned models loaded by |
| 31 | + model_servers. |
| 32 | + """ |
| 33 | + |
| 34 | + def __init__(self, channel): |
| 35 | + """Constructor. |
| 36 | +
|
| 37 | + Args: |
| 38 | + channel: A grpc.Channel. |
| 39 | + """ |
| 40 | + self.Classify = channel.unary_unary( |
| 41 | + '/tensorflow.serving.PredictionService/Classify', |
| 42 | + request_serializer=tensorflow__serving_dot_apis_dot_classification__pb2.ClassificationRequest.SerializeToString, |
| 43 | + response_deserializer=tensorflow__serving_dot_apis_dot_classification__pb2.ClassificationResponse.FromString, |
| 44 | + ) |
| 45 | + self.Regress = channel.unary_unary( |
| 46 | + '/tensorflow.serving.PredictionService/Regress', |
| 47 | + request_serializer=tensorflow__serving_dot_apis_dot_regression__pb2.RegressionRequest.SerializeToString, |
| 48 | + response_deserializer=tensorflow__serving_dot_apis_dot_regression__pb2.RegressionResponse.FromString, |
| 49 | + ) |
| 50 | + self.Predict = channel.unary_unary( |
| 51 | + '/tensorflow.serving.PredictionService/Predict', |
| 52 | + request_serializer=tensorflow__serving_dot_apis_dot_predict__pb2.PredictRequest.SerializeToString, |
| 53 | + response_deserializer=tensorflow__serving_dot_apis_dot_predict__pb2.PredictResponse.FromString, |
| 54 | + ) |
| 55 | + self.MultiInference = channel.unary_unary( |
| 56 | + '/tensorflow.serving.PredictionService/MultiInference', |
| 57 | + request_serializer=tensorflow__serving_dot_apis_dot_inference__pb2.MultiInferenceRequest.SerializeToString, |
| 58 | + response_deserializer=tensorflow__serving_dot_apis_dot_inference__pb2.MultiInferenceResponse.FromString, |
| 59 | + ) |
| 60 | + self.GetModelMetadata = channel.unary_unary( |
| 61 | + '/tensorflow.serving.PredictionService/GetModelMetadata', |
| 62 | + request_serializer=tensorflow__serving_dot_apis_dot_get__model__metadata__pb2.GetModelMetadataRequest.SerializeToString, |
| 63 | + response_deserializer=tensorflow__serving_dot_apis_dot_get__model__metadata__pb2.GetModelMetadataResponse.FromString, |
| 64 | + ) |
| 65 | + |
| 66 | + |
| 67 | +class PredictionServiceServicer(object): |
| 68 | + """open source marker; do not remove |
| 69 | + PredictionService provides access to machine-learned models loaded by |
| 70 | + model_servers. |
| 71 | + """ |
| 72 | + |
| 73 | + def Classify(self, request, context): |
| 74 | + """Classify. |
| 75 | + """ |
| 76 | + context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 77 | + context.set_details('Method not implemented!') |
| 78 | + raise NotImplementedError('Method not implemented!') |
| 79 | + |
| 80 | + def Regress(self, request, context): |
| 81 | + """Regress. |
| 82 | + """ |
| 83 | + context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 84 | + context.set_details('Method not implemented!') |
| 85 | + raise NotImplementedError('Method not implemented!') |
| 86 | + |
| 87 | + def Predict(self, request, context): |
| 88 | + """Predict -- provides access to loaded TensorFlow model. |
| 89 | + """ |
| 90 | + context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 91 | + context.set_details('Method not implemented!') |
| 92 | + raise NotImplementedError('Method not implemented!') |
| 93 | + |
| 94 | + def MultiInference(self, request, context): |
| 95 | + """MultiInference API for multi-headed models. |
| 96 | + """ |
| 97 | + context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 98 | + context.set_details('Method not implemented!') |
| 99 | + raise NotImplementedError('Method not implemented!') |
| 100 | + |
| 101 | + def GetModelMetadata(self, request, context): |
| 102 | + """GetModelMetadata - provides access to metadata for loaded models. |
| 103 | + """ |
| 104 | + context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 105 | + context.set_details('Method not implemented!') |
| 106 | + raise NotImplementedError('Method not implemented!') |
| 107 | + |
| 108 | + |
| 109 | +def add_PredictionServiceServicer_to_server(servicer, server): |
| 110 | + rpc_method_handlers = { |
| 111 | + 'Classify': grpc.unary_unary_rpc_method_handler( |
| 112 | + servicer.Classify, |
| 113 | + request_deserializer=tensorflow__serving_dot_apis_dot_classification__pb2.ClassificationRequest.FromString, |
| 114 | + response_serializer=tensorflow__serving_dot_apis_dot_classification__pb2.ClassificationResponse.SerializeToString, |
| 115 | + ), |
| 116 | + 'Regress': grpc.unary_unary_rpc_method_handler( |
| 117 | + servicer.Regress, |
| 118 | + request_deserializer=tensorflow__serving_dot_apis_dot_regression__pb2.RegressionRequest.FromString, |
| 119 | + response_serializer=tensorflow__serving_dot_apis_dot_regression__pb2.RegressionResponse.SerializeToString, |
| 120 | + ), |
| 121 | + 'Predict': grpc.unary_unary_rpc_method_handler( |
| 122 | + servicer.Predict, |
| 123 | + request_deserializer=tensorflow__serving_dot_apis_dot_predict__pb2.PredictRequest.FromString, |
| 124 | + response_serializer=tensorflow__serving_dot_apis_dot_predict__pb2.PredictResponse.SerializeToString, |
| 125 | + ), |
| 126 | + 'MultiInference': grpc.unary_unary_rpc_method_handler( |
| 127 | + servicer.MultiInference, |
| 128 | + request_deserializer=tensorflow__serving_dot_apis_dot_inference__pb2.MultiInferenceRequest.FromString, |
| 129 | + response_serializer=tensorflow__serving_dot_apis_dot_inference__pb2.MultiInferenceResponse.SerializeToString, |
| 130 | + ), |
| 131 | + 'GetModelMetadata': grpc.unary_unary_rpc_method_handler( |
| 132 | + servicer.GetModelMetadata, |
| 133 | + request_deserializer=tensorflow__serving_dot_apis_dot_get__model__metadata__pb2.GetModelMetadataRequest.FromString, |
| 134 | + response_serializer=tensorflow__serving_dot_apis_dot_get__model__metadata__pb2.GetModelMetadataResponse.SerializeToString, |
| 135 | + ), |
| 136 | + } |
| 137 | + generic_handler = grpc.method_handlers_generic_handler( |
| 138 | + 'tensorflow.serving.PredictionService', rpc_method_handlers) |
| 139 | + server.add_generic_rpc_handlers((generic_handler,)) |
0 commit comments