An attempt to learn MLFlow, by inferencing T5 transformer architecture and using it for text summarization. Here we are running the experiment using mlflow and then using mlflow for serving the model.
- clone the repo, install poetry using
pip install poetry
- run
poetry install
- run
poetry run python text_summarizer.py
ML Flow lets you track your different experiments along with serving models as APIs. you can check it out -
- run
mlflow ui
- open
localhost:5000
and checkout the run, and you can copy therun_id
You can serve any of your runs using MLFlow using the following command -
mlflow models serve -m runs:/<RUN_ID>/model --port=1234 --no-conda
and you can make curl requests to test the model like :
curl -X POST -H "Content-Type:application/json; format=pandas-split" --data '{"columns":["text"],"data":[["H.P.Lovecraft wrote his best books in Masachusettes."]]}' localhost:1234/invocations