- Newest
- Most votes
- Most comments
Hi and thanks for reaching out,
Today, the endpoint test UI in SageMaker Studio only supports application/json
content, so can't be used with endpoints like yours that don't support this content type: You'll need to use code, for example from a notebook or terminal.
From Python in particular you would have two options:
- The low-level
boto3
SDK as used here, which maps directly to the underlying InvokeEndpoint API and requires you to serialize your content (e.g. to CSV string) yourself, or - The high-level
sagemaker
SDK, which might be more familiar if you've followed tutorials with e.g. theEstimator
/Predictor
syntax.
Either is fine really... The high-level SDK just packages the process of stringifying and de-stringifying objects for the HTTP(S) request using the serializer and deserializer classes - so you would set your predictor up with the appropriate de/serializer and then just pass in the data as your usual e.g. DataFrame or nested list format:
import pandas as pd import sagemaker predictor = sagemaker.Predictor( "your-endpoint-name", serializer=sagemaker.serializers.CSVSerializer(), deserializer=sagemaker.deserializers.CSVDeserializer(), ) df = pd.read_csv("small-dataframe.csv") result = predictor.predict(df)
Alternatively if having the test UI is important for your use-case, you could explore other SageMaker algorithms that support JSON I/O? If you're using XGBoost you could consider using it in "framework mode" instead of "algorithm mode", letting you provide a custom inference script to parse JSON or whatever other request formats you'd like. If you're using AutoGluon-Tabular or one of the other "JumpStart-based" algorithms, you may be able to download, modify, and re-upload the inference deploy_source_uri
(see this example) to likewise accept custom request/response types.
Thanks @Alex for update. It will be good if AWS test endpoint UI also support another types as well. As every new developer/learner starts with Abalone example, so they are expecting result on UI interface as well. This is the very basic and initial requirement of AWS test endpoint UI.
Thanks again.
Relevant content
- asked 10 months ago
- Accepted Answer
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 2 years ago