Effortless model deployment with MLflow — Models with multiple pieces
How to save your Machine Learning models in an open-source format with MLflow to unlock effortless deployment experience later. Saving a recommendation system model.
12 min readApr 5, 2022
Welcome back to the series Effortless model deployment with MLflow! If you just join the party, check out the other post of the series:
- MLFlow: Introduction to the MLModel specification.
- Customizing inference with MLFlow: deploying a Computer Vision model with fast.ai.
- Packaging models with multiple pieces (this post).
- Packaging models with multiple assets: deploying a HuggingFace NLP model for classification.
- Packaging stratified models (many models): deploying a partitioned model for demand forecasting.
Introduction: Your model has many pieces
In the first post, we saw an introduction to the MLModel format and why, by persisting your model in an open-source specification format you can achieve great flexibility in deploying models. The only thing it took was to log the model like:
mlflow.keras.log_model(your_model, "classifier", signature)
In the second one, we saw how you can customize the way you run inference for a given model while continuing to keep the…