@philschmid Thanks for the reply.
I tried this one
import os
import io
import boto3
import json
import csv

grab environment variables
ENDPOINT_NAME = os.environ[‘ENDPOINT_NAME’]
runtime= boto3.client(‘runtime.sagemaker’)
def lambda_handler(event, context):
print("Received event: " + json.dumps(event, indent=2))
data = json.loads(json.dumps(event))
payload = data['data']
print(payload)

response = runtime.invoke_endpoint(EndpointName=ENDPOINT_NAME,
                                   ContentType='text/csv',
                                   Body=payload)
print(response)
result = json.loads(response['Body'].read().decode())
print(result)

But i am not getting the summary output. Can you provide a sample code for lambda function where i can give paragraph as input and i should get summary as output for my huggingface bart model endpoint.