This project focuses on embedding a Machine Learning model into a web application using FastAPI, including Dockerization and deployment on Hugging Face. The primary aim is to develop a predictive model for sepsis risk in ICU patients, enhancing healthcare professionals' capabilities through an accessible online platform.
This project aims to:
- Embed a Machine Learning model into a user-friendly web application.
- Integrate advanced ML algorithms and models for interactive use.
- Dockerize the application for easy deployment.
- Deploy the app on Hugging Face for accessibility.
Below is a preview showcasing the app's appearance.
- FastAPI: A modern, fast (high-performance) web framework for building APIs.
- Docker: Containerization platform for packaging applications.
- Hugging Face: An AI research organization providing models and resources.
- Python 3.11: The programming language used for development.
To install and run this project, follow these steps:
# Clone the repository
git clone https://github.com/Israel-Anaba/Embed_ML_Model_Web_App
# Change directory
cd Embed_ML_Model_Web_App
# Install dependencies
pip install -r requirements.txt
# Run the FastAPI application
uvicorn main:app --reloadHere's how you can use the project:
- Access the web application at http://localhost:8000 in your browser.
- Interact with the ML model through the user-friendly interface with features like the patients : Plasma glucose level,Body mass index,Blood pressure levels etc
For detailed documentation and API usage, visit http://localhost:8000/docs after running the app locally.
First create a Dockerfile, check documention : Docker Official Documentation - Dockerfile reference
Dockerize the application with the following commands:
# Build the Docker image
docker build -t app_name-app .
# Run the Docker container
docker run -p 80:80 app_name-appThe APP was further deployed on huggingface. You can interact with the app via huggingface following the steps below.
To access the sepsis prediction app, you will need to be signed in to Hugging Face:
- If you don't have a Hugging Face account, you can sign up for free at Hugging Face.
- After signing in, you can access the app using the following URL: 🤖https://gr8testgad-1-sepsis-prediction.hf.space/docs
Please note that you need to be signed in to Hugging Face to utilize this service. If you encounter any issues or have questions, feel free to checkout the huggingface documentation Huggingface Documentation for assistance.
| Name | Article Link | Github |
|---|---|---|
| Israel Anaba Ayamga | FastAPI Unleashed: Integrating Machine Learning Models with Ease | Israel_Anaba |
This project is licensed under the MIT License.
Contributions are welcome! Feel free to open an issue or submit a pull request.
I would like to express my gratitude to the Azubi Africa Data Analyst Program for their support and for offering valuable projects as part of this program. Not forgeting my scrum masters on this project Rachel Appiah-Kubi & Emmanuel Koupoh
For questions or feedback, please contact Israel Anaba Ayamga.


