Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

test.py 500 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  1. from data import test
  2. import boto3
  3. import json
  4. endpoint_name = "prod-endpoint"
  5. region = 'us-east-1'
  6. sm = boto3.client('sagemaker', region_name=region)
  7. smrt = boto3.client('runtime.sagemaker', region_name=region)
  8. test_data_json = json.dumps({'instances': test[:20].toarray()[:, :-1].tolist()})
  9. prediction = smrt.invoke_endpoint(
  10. EndpointName=endpoint_name,
  11. Body=test_data_json,
  12. ContentType='application/json'
  13. )
  14. prediction = prediction['Body'].read().decode("ascii")
  15. print(prediction)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...