README.md

XetHub mlflow Integration: Streamlining Experiment Tracking and Deployment

MLflow has gained popularity in the machine learning community due to its comprehensive set of features and ease of use.

It provides a seamless solution for experiment tracking, allowing researchers and data scientists to efficiently keep track of their experiments, parameters, and results.

Here we will give a demo of how to use the the mlflow-xethub integration.

Setup

  1. Install the XetHub CLI
  2. go to the project page and Duplicate the repo with the purple Duplicate button on the top left.
  3. Clone the repo to your local machine:
    git xet clone https://xethub.com/<username>/<repo>.git && cd <repo>
    
  4. Create a virtual environment and install the dependencies:
    python3.10 -m venv .venv 
    source .venv/bin/activate 
    pip install -f requirements.txt
    

Run

# Run server
python main.py server xet://<username>/<repo>/<branch>

# Run training
python main.py run

Copy mlruns to another branch

xet cp -r mlruns xet://<username>/<repo>/<branch>

UI

# if not cloned
git xet clone https://xethub.com/<user>/mlflow-tutorial.git --lazy runs && cd runs

mlflow ui

Serve

xet mount xet://<user>/<project>/main models
mlflow models serve -m models/mlruns/0/<run-id>/artifacts/model --no-conda -p 5000

# query from another terminal
curl http://127.0.0.1:5000/invocations -H 'Content-Type: application/json' -d '{
  "dataframe_records": [{"age": 0.038075906433423,
  "sex": 0.0506801187398186,
  "bmi": 0.0616962065186832,
  "bp": 0.0218723855140367,
  "s1": -0.0442234984244459,
  "s2": -0.0348207628376989,
  "s3": -0.0434008456520249,
  "s4": -0.0025922619981832,
  "s5": 0.0199074861704627,
  "s6": -0.0176461251598037
}]
}'
File List Total items: 7
Name Last Commit Size Last Modified
data add data as a csv 7 months ago
mlruns/0 copy mlruns to xet://xdssio/mlflow-tutorial/main recursively 7 months ago
.gitattributes
79 B
.gitignore
3.0 KiB
README.md add serve and setup to readme 1.9 KiB 7 months ago
main.py add serve and setup to readme 3.6 KiB 7 months ago
requirements.txt
89 B

Repository Size

Loading repo size...

Commits 24 commits

File Types