SageMakerTrainingSessionRuntime / Client / sample_training_session

sample_training_session

SageMakerTrainingSessionRuntime.Client.sample_training_session(**kwargs)

Sends an inference request to the model associated with the specified training session and returns the response synchronously. The service passes the request and response bodies to and from the model without modification.

See also: AWS API Documentation

Request Syntax

response = client.sample_training_session(
    trainingSessionName='string',
    contentType='string',
    accept='string',
    modelPackageArn='string',
    body=b'bytes'|file
)
Parameters:
  • trainingSessionName (string) –

    [REQUIRED]

    The name of the training session whose model to invoke.

  • contentType (string) – The MIME type of the input data in the request body.

  • accept (string) – The desired MIME type of the inference body in the response.

  • modelPackageArn (string) – The ARN of the model package whose checkpoint to invoke.

  • body (bytes or seekable file-like object) – The raw inference request body.

Return type:

dict

Returns:

Response Syntax

{
    'contentType': 'string',
    'body': StreamingBody()
}

Response Structure

  • (dict) –

    • contentType (string) –

      The MIME type of the inference result in the response body.

    • body (StreamingBody) –

      The raw inference response body from the model.

Exceptions