| Technology | Description |
|---|---|
| A Python library for building and training machine learning models. | |
| A collaboration platform for machine learning, hosting data and MLflow models. | |
| A platform to manage the ML lifecycle, including model tracking and deployment. | |
| A modern web framework for building APIs with Python, known for its speed. | |
| A Python library for data validation. Used to validate API data. | |
| A testing framework for Python, used to test the FastAPI application. | |
| An API to access and manage YouTube video data, including comments. | |
| A cloud platform for hosting APIs, websites, and applications. |
What I Followed to Know?
Important
- As I am learning Python, Data Science and Machine Learning for more than 3 years. I don’t have to look around to learn new things to build this. This part is kind of easy for me.
- But as I said earlier, the documentations and ChatGPT is most important resources you can onto. :wink:
- Need to get an API key from Google Developer Console to interact with YouTube Data API.
- Need to create an account on DagsHub to store/track MLFlow experiments and models.
- Created a DVC pipeline to run the MLFlow experiments seemlessly using
dvc reprocommand. - After creating the FastAPI app, I’ve used
pytestto test it and also setup apre-commitfor it. - Deployment on render.com.
What Type of Problems I Have Faced?
Render.com
-
As I have used
uvto manage my project but render.com doesn’t supportuvout-of-the-box so I have usedpipto useuvfor dependencies installation.pip install uv && uv sync --extra=backend --compile-bytecode -
Also, render.com only serve apps on port under
$PORTenv (which10000most of the times) so make sure to explicitly provide while running app throughuvicornorfastapi-cliCLI.# For uvicorn uvicorn run --host 0.0.0.0 --port $PORT backend.app:app # For fastapi-cli fastapi run --host 0.0.0.0 --port $PORT backend/app.py
Docker
-
I am using
wordcloudto create a plot in a FastAPI route. While building docker image FROMpython:3.11-slimimage, I am getting error becausewordcloudpackage needsgccpackage to build wheels. So you need to explicitly installgccbefore installwordcloudas python package.# Install gcc for wordcloud RUN apt-get update && apt-get install -y gcc && apt-get clean # Now install project dependencies including wordcloud # ... -
Also use multistage builds in
Dockerfileto reduce the image size. Seeuvdocs.