in scripts/Evaluate/lambda_function.py [0:0]
def get_sagemaker_response(endpoint_name, content_type, accept, sagemakerbody):
try:
response = sagemaker.invoke_endpoint(
EndpointName=endpoint_name,
ContentType=content_type,
Accept=accept,
Body=sagemakerbody
)
logger.info(response)
decoded_response = response['Body'].read().decode('utf-8')
return decoded_response
except Exception as e:
logger.error(e, exc_info=True)