File size: 652 Bytes
e00e050
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import sagemaker
from aws_helper import get_sagemaker_session

# artifact = Client().get_artifact('54507ebb-5e1c-4283-ad39-8e8558eab289')
# endpoint_name = artifact.load()
endpoint_name = "huggingface-pytorch-inference-2023-11-02-13-25-13-481"

predictor = sagemaker.Predictor(
    endpoint_name=endpoint_name,
    sagemaker_session=get_sagemaker_session(),
    serializer=sagemaker.serializers.JSONSerializer(),
    deserializer=sagemaker.deserializers.JSONDeserializer(),
)
res = predictor.predict({"inputs": "what is this "})
# #probabilities, labels, predicted_label = parse_response(res)
# print(probabilities, labels, predicted_label)
print(res)