-
Notifications
You must be signed in to change notification settings - Fork 100
More clarity on using Context in pre/post-processing scripts #184
Description
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.