Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

More clarity on using Context in pre/post-processing scripts #184

@nathanielrindlaub

Description

@nathanielrindlaub

What did you find confusing? Please describe.
I am trying to make use of the model_name attribute in the Context object that gets passed into my input handler, which the documentation indicates is created by the Python service, but the docs do not indicate where those attribute values come from or how to set them when deploying a model endpoint. In my case, I get Context object with very little useful information, and it would be helpful to know how to set those values. Here's what my Context looks like printed out when a request comes in:

Context(model_name=None, model_version=None, method=None, rest_uri='http://localhost:10001/v1/models/Servo:predict', grpc_port='10000', custom_attributes=None, request_content_type='application/x-image', accept_header='*/*', content_length=1417)

I've tried a bunch of things (setting the name parameter when creating the Model, setting the endpoint_name param when calling model.deploy(), passing env: {'SAGEMAKER_TFS_DEFAULT_MODEL_NAME': '<model-name>'} into the Model as described in this gist) to no avail.

Describe how documentation can be improved
A little more guidance on how to manipulate and use the Context object would be awesome.

Additional context
Note: my endpoints are single-model endpoints, not multi-model endpoints. Not sure if that is relevant or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions