YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

MLOps CI/CD β€” GitHub Actions + Hugging Face Hub

Every push to main trains a model, evaluates it, and β€” only if it passes an accuracy threshold β€” deploys it to Hugging Face Hub automatically.

How it works

push/PR to GitHub
        β”‚
        β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”
  β”‚ test β”‚   pytest sanity checks
  β””β”€β”€β”¬β”€β”€β”€β”˜
     β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ train_and_evaluate  β”‚  prepare β†’ train β†’ evaluate
  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  ← fails here if accuracy < params.yaml threshold
         β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ deploy_to_huggingface β”‚  only on push to main, only if gate passed
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  re-trains + pushes model to your HF repo

Setup

1. Create a Hugging Face account + token

2. Create the GitHub repo and push this code

cd mlops-simple
git init
git add .
git commit -m "Initial MLOps pipeline"
git branch -M main
git remote add origin https://github.com/<your-username>/<your-repo>.git
git push -u origin main

3. Add your HF token as a GitHub secret

In your GitHub repo: Settings β†’ Secrets and variables β†’ Actions β†’ New repository secret

  • Name: HF_TOKEN
  • Value: the token from step 1

4. Add your target HF repo as a GitHub variable

Same page, Variables tab β†’ New repository variable

  • Name: HF_REPO_ID
  • Value: your-hf-username/your-model-name (e.g. mupalaniappan/breast-cancer-rf) β€” it'll be created automatically on first successful run if it doesn't exist yet.

5. Push to main

That's it β€” the workflow runs automatically. Check the Actions tab in GitHub to watch it, and once deploy_to_huggingface finishes, your model is live at https://huggingface.co/your-hf-username/your-model-name.

Adjusting the quality gate

Edit evaluate.min_accuracy in params.yaml. Anything scoring below that never reaches Hugging Face β€” the deploy_to_huggingface job simply doesn't run.

Try it locally first (optional but recommended)

pip install -r requirements.txt
python src/prepare.py
python src/train.py
python src/evaluate.py
cat metrics.json

CI/CD deployment configured.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support