hf-repo / predict.py
htahir1's picture
Upload folder using huggingface_hub
e00e050
raw
history blame
652 Bytes
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)