Skip to content

Instantly share code, notes, and snippets.

@azarnyx
Last active May 10, 2021 15:38
Show Gist options
  • Save azarnyx/b02c24e21c3ba76649f5c47a6b441985 to your computer and use it in GitHub Desktop.
Save azarnyx/b02c24e21c3ba76649f5c47a6b441985 to your computer and use it in GitHub Desktop.
# Deserialize the Invoke request body into an object we can perform prediction on
input_object = input_fn(request_body, request_content_type)
# Load the model
model = model_fn(model_dir)
# Perform prediction on the deserialized object, with the loaded model
prediction = predict_fn(input_object, model)
# Serialize the prediction result into the desired response content type
output = output_fn(prediction, response_content_type)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment