-
Notifications
You must be signed in to change notification settings - Fork 0
/
grpc_predict_v2_pb2_grpc.py
247 lines (224 loc) · 11 KB
/
grpc_predict_v2_pb2_grpc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import grpc_predict_v2_pb2 as grpc__predict__v2__pb2
class GRPCInferenceServiceStub(object):
"""Inference Server GRPC endpoints.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.ServerLive = channel.unary_unary(
'/inference.GRPCInferenceService/ServerLive',
request_serializer=grpc__predict__v2__pb2.ServerLiveRequest.SerializeToString,
response_deserializer=grpc__predict__v2__pb2.ServerLiveResponse.FromString,
)
self.ServerReady = channel.unary_unary(
'/inference.GRPCInferenceService/ServerReady',
request_serializer=grpc__predict__v2__pb2.ServerReadyRequest.SerializeToString,
response_deserializer=grpc__predict__v2__pb2.ServerReadyResponse.FromString,
)
self.ModelReady = channel.unary_unary(
'/inference.GRPCInferenceService/ModelReady',
request_serializer=grpc__predict__v2__pb2.ModelReadyRequest.SerializeToString,
response_deserializer=grpc__predict__v2__pb2.ModelReadyResponse.FromString,
)
self.ServerMetadata = channel.unary_unary(
'/inference.GRPCInferenceService/ServerMetadata',
request_serializer=grpc__predict__v2__pb2.ServerMetadataRequest.SerializeToString,
response_deserializer=grpc__predict__v2__pb2.ServerMetadataResponse.FromString,
)
self.ModelMetadata = channel.unary_unary(
'/inference.GRPCInferenceService/ModelMetadata',
request_serializer=grpc__predict__v2__pb2.ModelMetadataRequest.SerializeToString,
response_deserializer=grpc__predict__v2__pb2.ModelMetadataResponse.FromString,
)
self.ModelInfer = channel.unary_unary(
'/inference.GRPCInferenceService/ModelInfer',
request_serializer=grpc__predict__v2__pb2.ModelInferRequest.SerializeToString,
response_deserializer=grpc__predict__v2__pb2.ModelInferResponse.FromString,
)
class GRPCInferenceServiceServicer(object):
"""Inference Server GRPC endpoints.
"""
def ServerLive(self, request, context):
"""The ServerLive API indicates if the inference server is able to receive
and respond to metadata and inference requests.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ServerReady(self, request, context):
"""The ServerReady API indicates if the server is ready for inferencing.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ModelReady(self, request, context):
"""The ModelReady API indicates if a specific model is ready for inferencing.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ServerMetadata(self, request, context):
"""The ServerMetadata API provides information about the server. Errors are
indicated by the google.rpc.Status returned for the request. The OK code
indicates success and other codes indicate failure.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ModelMetadata(self, request, context):
"""The per-model metadata API provides information about a model. Errors are
indicated by the google.rpc.Status returned for the request. The OK code
indicates success and other codes indicate failure.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ModelInfer(self, request, context):
"""The ModelInfer API performs inference using the specified model. Errors are
indicated by the google.rpc.Status returned for the request. The OK code
indicates success and other codes indicate failure.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_GRPCInferenceServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'ServerLive': grpc.unary_unary_rpc_method_handler(
servicer.ServerLive,
request_deserializer=grpc__predict__v2__pb2.ServerLiveRequest.FromString,
response_serializer=grpc__predict__v2__pb2.ServerLiveResponse.SerializeToString,
),
'ServerReady': grpc.unary_unary_rpc_method_handler(
servicer.ServerReady,
request_deserializer=grpc__predict__v2__pb2.ServerReadyRequest.FromString,
response_serializer=grpc__predict__v2__pb2.ServerReadyResponse.SerializeToString,
),
'ModelReady': grpc.unary_unary_rpc_method_handler(
servicer.ModelReady,
request_deserializer=grpc__predict__v2__pb2.ModelReadyRequest.FromString,
response_serializer=grpc__predict__v2__pb2.ModelReadyResponse.SerializeToString,
),
'ServerMetadata': grpc.unary_unary_rpc_method_handler(
servicer.ServerMetadata,
request_deserializer=grpc__predict__v2__pb2.ServerMetadataRequest.FromString,
response_serializer=grpc__predict__v2__pb2.ServerMetadataResponse.SerializeToString,
),
'ModelMetadata': grpc.unary_unary_rpc_method_handler(
servicer.ModelMetadata,
request_deserializer=grpc__predict__v2__pb2.ModelMetadataRequest.FromString,
response_serializer=grpc__predict__v2__pb2.ModelMetadataResponse.SerializeToString,
),
'ModelInfer': grpc.unary_unary_rpc_method_handler(
servicer.ModelInfer,
request_deserializer=grpc__predict__v2__pb2.ModelInferRequest.FromString,
response_serializer=grpc__predict__v2__pb2.ModelInferResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'inference.GRPCInferenceService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class GRPCInferenceService(object):
"""Inference Server GRPC endpoints.
"""
@staticmethod
def ServerLive(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/inference.GRPCInferenceService/ServerLive',
grpc__predict__v2__pb2.ServerLiveRequest.SerializeToString,
grpc__predict__v2__pb2.ServerLiveResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ServerReady(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/inference.GRPCInferenceService/ServerReady',
grpc__predict__v2__pb2.ServerReadyRequest.SerializeToString,
grpc__predict__v2__pb2.ServerReadyResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ModelReady(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/inference.GRPCInferenceService/ModelReady',
grpc__predict__v2__pb2.ModelReadyRequest.SerializeToString,
grpc__predict__v2__pb2.ModelReadyResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ServerMetadata(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/inference.GRPCInferenceService/ServerMetadata',
grpc__predict__v2__pb2.ServerMetadataRequest.SerializeToString,
grpc__predict__v2__pb2.ServerMetadataResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ModelMetadata(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/inference.GRPCInferenceService/ModelMetadata',
grpc__predict__v2__pb2.ModelMetadataRequest.SerializeToString,
grpc__predict__v2__pb2.ModelMetadataResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ModelInfer(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/inference.GRPCInferenceService/ModelInfer',
grpc__predict__v2__pb2.ModelInferRequest.SerializeToString,
grpc__predict__v2__pb2.ModelInferResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)