aws_lambda/pytorch-serverless/aws/pytorch/prediction.py
def lambda_handler(event, context):
    """The main function which is called in the lambda function as defined in our template.yml"""

    image_tensor = image_to_tensor(preprocess_pipeline, event['body'])
    response = predict(model, classes, image_tensor)
    return {
        "statusCode": 200,
        "body": json.dumps(response)
    }
The main function which is called in the lambda function as defined in our template.yml
The main function which is called in the lambda function as defined in our template.yml
The main function which is called in the lambda function as defined in our template . yml
def lambda_handler(event, context):
    image_tensor = image_to_tensor(preprocess_pipeline, event['body'])
    response = predict(model, classes, image_tensor)
    return {
        "statusCode": 200,
        "body": json.dumps(response)
    }
def lambda_handler ( event , context ) : image_tensor = image_to_tensor ( preprocess_pipeline , event [ 'body' ] ) response = predict ( model , classes , image_tensor ) return { "statusCode" : 200 , "body" : json . dumps ( response ) }
The main function which is called in the lambda function as defined in our template.yml
The main function which is called in the lambda function as defined in our template . yml
"""The main function which is called in the lambda function as defined in our template.yml"""
event
context