Instructions to use MSGEncrypted/minicpm5-1b-math-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use MSGEncrypted/minicpm5-1b-math-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("openbmb/MiniCPM5-1B") model = PeftModel.from_pretrained(base_model, "MSGEncrypted/minicpm5-1b-math-lora") - Notebooks
- Google Colab
- Kaggle
Publish math LoRA adapter with benchmark results
Browse files9 unmodified lines10111213141516171819202122232425262728293031323334354 unmodified lines40414243444546474849503 unmodified lines54555657585960616263649 unmodified lines- math---# math-loraQLoRA adapter for **math**, fine-tuned from `openbmb/MiniCPM5-1B` on `meta-math/MetaMathQA` + `tatsu-lab/alpaca` (format: `mix`).Trained, evaluated, and gated on [Modal](https://modal.com/docs/guide) via `research/modal/` (app `slm-finetune-benchmark`).## Benchmark gate- eval profile: `math`- gate: **PASSED**| check | value | result || --- | ---: | --- || gsm8k >= 0.05 | 0.4000 | pass || gsm8k improve >= 0.02 | 0.0700 | pass || arc_challenge regress <= 0.03 | -0.0500 | pass || hellaswag regress <= 0.03 | 0.0000 | pass || piqa regress <= 0.03 | 0.0200 | pass |## lm-eval results| task | metric | baseline | candidate | delta || --- | --- | ---: | ---: | ---: |4 unmodified lines## Training- dataset: `/repo/research/data/education-lesson-chat.jsonl`- mode: `qlora`- samples: {'train': 3528, 'eval': 72}- final train loss: 0.340698- eval loss: 0.494981## Load with PEFT3 unmodified linesbase = "openbmb/MiniCPM5-1B"adapter = "MSGEncrypted/minicpm5-1b-math-lora"tokenizer = AutoTokenizer.from_pretrained(base, trust_remote_code=True)model = AutoModelForCausalLM.from_pretrained(base, torch_dtype="auto", device_map="auto", trust_remote_code=True)model = PeftModel.from_pretrained(model, adapter)```9 unmodified lines101112131415161718192021224 unmodified lines2728293031323334353 unmodified lines394041424344459 unmodified lines- math---# minicpm5-1b-math-loraQLoRA math adapter for openbmb/MiniCPM5-1B, trained on meta-math/MetaMathQA with tatsu-lab/alpaca replay.## Benchmark comparisonEvaluated with research/evals/configs/lm_eval_math.yaml on Modal using slm-lm-eval.| task | metric | baseline | candidate | delta || --- | --- | ---: | ---: | ---: |4 unmodified lines## Training- train loss: -- eval loss: 0.494981- result score: -## Load with PEFT3 unmodified linesbase = "openbmb/MiniCPM5-1B"adapter = "MSGEncrypted/minicpm5-1b-math-lora"tokenizer = AutoTokenizer.from_pretrained(base, trust_remote_code=True)model = AutoModelForCausalLM.from_pretrained(base, torch_dtype="auto", device_map="auto", trust_remote_code=True)model = PeftModel.from_pretrained(model, adapter)```
README.md+7-26