Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I access Custom Attributes from the model during inference? #111

Open
bml1g12 opened this issue Nov 5, 2021 · 1 comment
Open

Comments

@bml1g12
Copy link

bml1g12 commented Nov 5, 2021

What did you find confusing? Please describe.
It is clear how to invoke an endpoint with Custom Attributes but it is completely unclear to me how one would access this information from the Pytorch SDK inference code. I can see for the Tensorflow SDK they have documentation for it and imply the second argument of the input handler function will provide access to it but it seems in the Pytorch framework it is just a string indicating the input content MIME type.

It would seem from the source that the context object is not passed to the transformation functions, so not accessible at all to the user.

Describe how documentation can be improved
Explanation of how to access provided custom attributes using the Pytorch Inference Toolkit

Additional context
I want to achieve what is being done here https://aws.amazon.com/marketplace/pp/prodview-5jlvp43tsn3ny?sr=0-1&ref_=beagle&applicationId=AWSMPContessa - namely the ability to provide a confidence threshold to an inference request. I would like to use a binary format for the body of the payload (image/jpeg) so I cannot provide parameters as part of the body itself like if the body were a JSON.

@alar0330
Copy link

alar0330 commented Apr 3, 2022

You would have to implement your custom Transformer and set it to be used by the stack's serving Handler Service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants