Skip to content

Latest commit

 

History

History
138 lines (79 loc) · 3.36 KB

File metadata and controls

138 lines (79 loc) · 3.36 KB

class GrpcClient


method get_model_metadata

get_model_metadata(request)

Send GrpcModelMetadataRequest to the server and return response.

Args:

  • request: GrpcModelMetadataRequest object.

Returns: GrpcModelMetadataResponse object

Raises:

  • TypeError: if request argument is of wrong type.
  • ValueError: if request argument has invalid contents.
  • ConnectionError: if there was an error while sending request to the server.

Examples:

config = {
    "address": "localhost",
    "port": 9000
}
client = make_grpc_client(config)
request = make_model_metadata_request("model")
response = client.get_model_metadata(request)

method get_model_status

get_model_status(request)

Send GrpcModelStatusRequest to the server and return response.

Args:

  • request: GrpcModelStatusRequest object.

Returns: GrpcModelStatusResponse object

Raises:

  • TypeError: if request argument is of wrong type.
  • ValueError: if request argument has invalid contents.
  • ConnectionError: if there was an error while sending request to the server.

Examples:

config = {
    "address": "localhost",
    "port": 9000
}
client = make_grpc_client(config)
request = make_model_status_request("model")
response = client.get_model_status(request)

method predict

predict(request)

Send GrpcPredictRequest to the server and return response.

Args:

  • request: GrpcPredictRequest object.

Returns: GrpcPredictResponse object

Raises:

  • TypeError: if request argument is of wrong type.
  • ValueError: if request argument has invalid contents.
  • ConnectionError: if there was an error while sending request to the server.

Examples:

config = {
"address": "localhost",
"port": 9000
}
client = make_grpc_client(config)
request = make_predict_request({"input": [1, 2, 3]}, "model")
response = client.predict(request)

Return to the main page