Created
May 1, 2021 17:18
-
-
Save azarnyx/96e29fe8235db8911c0f77061d221386 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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