| title | emoji | colorFrom | colorTo | sdk | app_file | pinned | license | duplicable |
|---|---|---|---|---|---|---|---|---|
Tech Stack Advisor |
🧠 |
indigo |
pink |
docker |
app.py |
false |
apache-2.0 |
true |
Tech Stack Advisor is a hands-on machine learning project designed to teach you how to build, containerize, and deploy an ML-powered web application using Docker and Hugging Face Spaces.
🎯 This project is part of the "Artificial Intelligence and Machine Learning (AI/ML) with Docker" course from School of DevOps.
- Build and train a simple ML model using
scikit-learn - Create a UI using
Gradio - Containerize your app using a Dockerfile
- Push your Docker image to Docker Hub
- Deploy the Dockerized app on Hugging Face Spaces (free tier)
tech-stack-advisor/
├── app.py # Gradio web app
├── train.py # Script to train and save ML model
├── requirements.txt # Python dependencies
├── Dockerfile # Docker build file (added during the lab)
├── model.pkl # Trained ML model (generated after training)
├── encoders.pkl # Encoders for categorical inputs (generated after training)
├── LICENSE # Apache 2.0 license
└── README.md # This guide
- Clone the repository
git clone https://github.com/<your-username>/tech-stack-advisor.git
cd tech-stack-advisor- Install dependencies
(Optional: Use a virtual environment)
pip install -r requirements.txt- Train the model
python train.pyThis creates:
model.pkl: the trained ML modelencoders.pkl: label encoders for input/output features
python app.pyVisit the app in your browser at:
http://localhost:7860
Create a file named Dockerfile in the root of the project:
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 7860
CMD ["python", "app.py"]- Build the image
docker build -t tech-stack-advisor .- Run the container
docker run -p 7860:7860 tech-stack-advisorVisit: http://localhost:7860
- Login to Docker Hub
docker login- Tag the image
docker tag tech-stack-advisor <your-dockerhub-username>/tech-stack-advisor:latest- Push it
docker push <your-dockerhub-username>/tech-stack-advisor:latest-
Go to huggingface.co/spaces
-
Click Create New Space
-
Select:
- SDK: Docker
- Repository: Link to your GitHub repo with the Dockerfile
-
Hugging Face will auto-build and deploy your container.
- Can you swap the model in
train.pyfor aLogisticRegressionmodel? - Can you add logging to show which inputs were passed?
- Try changing the Gradio layout or theme!
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Created by [Gourav Shah](https://www.linkedin.com/in/gouravshah) as part of the AI/ML with Docker course at School of DevOps.
🛠 Happy shipping, DevOps and MLOps builders!