{
"cells": [
{
"cell_type": "markdown",
"id": "63ab391a",
"metadata": {},
"source": [
"# Intro to MLOps using ZenML\n",
"\n",
"## 🌍 Overview\n",
"\n",
"This repository is a minimalistic MLOps project intended as a starting point to learn how to put ML workflows in production. It features: \n",
"\n",
"Follow along this notebook to understand how you can use ZenML to productionalize your ML workflows!\n",
"\n",
""
]
},
{
"cell_type": "markdown",
"id": "8c28b474",
"metadata": {},
"source": [
"# ⌚ Step 2: Training pipeline"
]
},
{
"cell_type": "markdown",
"id": "87909827",
"metadata": {},
"source": [
"Lets run the training pipeline\n",
"\n",
""
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fccf1bd9",
"metadata": {},
"outputs": [],
"source": [
"!python run.py --training-pipeline"
]
},
{
"cell_type": "markdown",
"id": "d6306f14",
"metadata": {},
"source": [
"# 🫅 Step 2: The inference pipeline"
]
},
{
"cell_type": "markdown",
"id": "b51f3108",
"metadata": {},
"source": [
"The batch inference pipeline simply takes the model marked as `production` and runs inference on it\n",
"with `live data`. The critical step here is the `inference_predict` step, where we load the model in memory\n",
"and generate predictions:\n",
"\n",
""
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9918a8a1-c569-494f-aa40-cb7bd3aaea07",
"metadata": {},
"outputs": [],
"source": [
"!python run.py --inference-pipeline"
]
},
{
"cell_type": "markdown",
"id": "36140d24-a280-48eb-bb03-5e03280e128c",
"metadata": {},
"source": [
"## Step 3: Deploying the pipeline to Huggingface"
]
},
{
"cell_type": "markdown",
"id": "13bd8087-2ab0-4f9d-8bff-6266a05eb6e7",
"metadata": {},
"source": [
""
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8000849c-1ce8-4900-846e-3ef1873561f8",
"metadata": {},
"outputs": [],
"source": [
"!python run.py --deployment-pipeline"
]
},
{
"cell_type": "markdown",
"id": "594ee4fc-f102-4b99-bdc3-2f1670c87679",
"metadata": {},
"source": [
"## Congratulations!\n",
"\n",
"You're a legit MLOps engineer now! You trained two models, evaluated them against\n",
"a test set, registered the best one with the ZenML model control plane,\n",
"and served some predictions. You also learned how to iterate on your models and\n",
"data by using some of the ZenML utility abstractions. You saw how to view your\n",
"artifacts and models via the client as well as the ZenML Dashboard.\n",
"\n",
"## Further exploration\n",
"\n",
"This was just the tip of the iceberg of what ZenML can do; check out the [**docs**](https://docs.zenml.io/) to learn more\n",
"about the capabilities of ZenML. For example, you might want to:\n",
"\n",
"- [Deploy ZenML](https://docs.zenml.io/user-guide/production-guide/connect-deployed-zenml) to collaborate with your colleagues.\n",
"- Run the same pipeline on a [cloud MLOps stack in production](https://docs.zenml.io/user-guide/production-guide/cloud-stack).\n",
"- Track your metrics in an experiment tracker like [MLflow](https://docs.zenml.io/stacks-and-components/component-guide/experiment-trackers/mlflow).\n",
"\n",
"## What next?\n",
"\n",
"* If you have questions or feedback... join our [**Slack Community**](https://zenml.io/slack) and become part of the ZenML family!\n",
"* If you want to quickly get started with ZenML, check out the [ZenML Cloud](https://zenml.io/cloud)."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}