Invoke_endpoint returns error - wrong payload format?
Hi,I am very new in the world of AI/LLMs so please bear with me.I want to play with an llm to summarize a text.I deployed a serverless sagemaker jumpstart model “infer-huggingface-summarization-bert-small2bert-small-finetuned-cnn-daily-mail-summarization” using cloudformation stack. The model and endpoint seem to be up and running.I am running this python code in a lambda for a simple “hello world” experimentclient = boto3.client('runtime.sagemaker')
payload = "Summarize this text: This is a beautiful day. I am happy. I am going to the park."
encoded_payload = json.dumps(payload).encode("utf-8")
response = client.invoke_endpoint(
  EndpointName="SummarizationEndpoint", 
  ContentType="application/json", 
  Accept="application/json",
  Body=encoded_payload
)it fails with the error:An error occurred: An error occurred (ModelError) when calling the InvokeEndpoint operation: Received client error (400) from model with message "
{
  "code": 400,
  "type": "InternalServerException",
  "message": "\u0027str\u0027 object has no attribute \u0027pop\u0027"
}"As this is a ModelError, I am assuming my sagemaker setup is correct and the lambda is indeed talking to the model. I am assuming I am just not passing the payload correctly over to the invoke_endpoint function or the model.I tried different formats forpayload.payload = {"inputs": "Summarize this text: This is a beautiful day. I am happy. I am going to the park."}… results in error"\u0027str\u0027 object is not callable"payload = {"input_texts": "Summarize this text: This is a beautiful day. I am happy. I am going to the park."}… results in errorargs[0]`: {\u0027input_texts\u0027: \u0027Summarize this text: This is a beautiful day. I am happy. I am going to the park.\u0027} have the wrong format. The should be either of type `str` or type `listJudging from the test codeheremy best guess would bepayload = {"inputs":"text"}but this doesn’t work.I am sure I am missing something very obvious but can’t see it. Can I see a working example or where this is documented?