Skip to content

Instantly share code, notes, and snippets.

@azarnyx
Created May 1, 2021 17:18
Show Gist options
  • Save azarnyx/96e29fe8235db8911c0f77061d221386 to your computer and use it in GitHub Desktop.
Save azarnyx/96e29fe8235db8911c0f77061d221386 to your computer and use it in GitHub Desktop.
import boto3
import json
client = boto3.client('sagemaker-runtime')
response = client.invoke_endpoint(
EndpointName=predictor.endpoint_name,
Body=json.dumps({"text": "preved medved"}),
ContentType='application/json',
Accept="application/json"
)
result = response['Body'].read().decode()
print(json.loads(json.loads(result))['proba'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment