Hi! PARIS Summer School 2024 - Exploring Machine Learning Deployment from beginner to advance level 🚀
This repository contains the demos for the Hi! PARIS Summer School 2024 session on Exploring Machine Learning Deployment from beginner to advance level 🚀.
The repository is divided into three folders, one for each practical demo:
streamlit-app/
for the Streamlit demosagemaker-deployment/
for the AWS SageMaker demodocker-app/
for the Docker + AWS Lambda demo
The session was hosted by Awais SANI, Senior Machine Learning engineer @ Hi! PARIS and Laurène DAVID, Machine Learning engineer @ Hi! PARIS.
To learn more about the Hi! PARIS Engineering Team, here are some useful links:
- Github: https://github.com/hi-paris
- Website: https://engineeringteam.hi-paris.fr/
- Deploy a Streamlit app: https://docs.streamlit.io/deploy/streamlit-community-cloud/deploy-your-app
- Manage streamlit secrets: https://docs.streamlit.io/deploy/streamlit-community-cloud/deploy-your-app/secrets-management
- Connect app to external data sources: https://docs.streamlit.io/develop/tutorials/databases
- Deploy an app to HuggingFace spaces: https://medium.com/@imanuelyosi/deploy-your-streamlit-web-app-using-hugging-face-7b9cddb11148
Launch the streamlit app locally
streamlit run streamlit-app/app.py
Build a requirements.txt
file to deploy the app via Streamlit Cloud
pip3 freeze > requirements.txt
First, you will need to create an AWS account if you don't already have one.
https://aws.amazon.com/?nc1=h_ls
Go to the Amazon SageMaker console and select the Notebooks option on the console's left tab. To create the notebook, click on Create notebook instance.
- Select a notebook instance name
- Select a notebook instance type
- Select a platform type for the notebook instance, for example the JupyterLab version you want to use
- For the IAM role, click on Create a new role option then create a role associed to the instance's S3 bucket.
Most of these configuration can be left with their default value. Only the creation of a new IAM role is mandatory to access the S3 bucket.
Once you've provided all the required information, you can now launch the notebook (this can take a couple of minutes). To stop the instance from running, click on the notebook instance then select Stop. This will be prevent additional costs.
- SageMaker Python SDK documentation: https://sagemaker.readthedocs.io/en/stable/index.html
- Host a pre-trained model on SageMaker: https://sagemaker-examples.readthedocs.io/en/latest/sagemaker-script-mode/pytorch_bert/deploy_bert_outputs.html
- Using Scikit-learn with the SageMaker Python SDK: https://sagemaker.readthedocs.io/en/stable/frameworks/sklearn/using_sklearn.html#deploy-a-scikit-learn-model
- Boto3 documentation: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html
- Use Docker containers to train and deploy models: https://docs.aws.amazon.com/sagemaker/latest/dg/docker-containers.html