Instructions to use thesimonharms/mclass with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use thesimonharms/mclass with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="thesimonharms/mclass")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("thesimonharms/mclass", device_map="auto") - Notebooks
- Google Colab
- Kaggle
mclass
Extract-then-classify coding preference model. It reads user text, harness messages, and code hunks. It writes typed labels with a percent.
The extractor copies candidate text from the user or from a diff template. The encoder does not invent a preference sentence.
- Code: https://git.simonharms.com/thesimonharms/mclass
- Weights: this repo
- License: MIT
- Base: sentence-transformers/all-MiniLM-L6-v2
Files
| file | role |
|---|---|
encoder/ |
MiniLM encoder and tokenizer after LoRA merge |
heads.pt |
kind head and category head |
mclass.json |
labels, temperature, max length, pooling |
model.onnx |
exported graph (kind logits and category logits) |
eval.json |
last measured scores |
Download into a local artifacts folder:
hf download thesimonharms/mclass --local-dir artifacts
Use
Install the code from git, then classify:
uv add "mclass @ git+https://git.simonharms.com/thesimonharms/mclass"
echo '{"user":"I want bun"}' | uv run mclass classify --artifacts artifacts
Or from a clone:
git clone https://git.simonharms.com/thesimonharms/mclass.git
cd mclass
uv sync --extra train
hf download thesimonharms/mclass --local-dir artifacts
echo '{"user":"I want bun"}' | uv run mclass classify
HTTP:
uv run mclass serve --port 8091 --artifacts artifacts
POST /v1/classify with { "user": "...", "harness": [], "code": [] }.
Labels
preferenceis true only whenkindisdurablekind:durable | session | task | correctioncategory:cli | language | architecture | testing | style | tooling | naming | git | docs | otherconfidenceis P(durable) after temperature scaling
Train notes
Mean-pool MiniLM. LoRA rank 8 on the last two layers. Full encoder backward can nan on gfx1151. Heads-only is --lora-r 0 --unfreeze-last 0.
Scores
Last LoRA run (mean pool, last-2 adapters):
| slice | metric | encoder | same-data Bayes |
|---|---|---|---|
| test | kind acc | 1.000 | โ |
| test | durable F1 | 1.000 | โ |
| user-text | durable F1 | 1.000 | 0.920 |
| gold (n=65) | kind acc | 0.985 | โ |
| gold | preference acc | 1.000 | โ |
| ood (n=40) | kind acc | 1.000 | โ |
| ood | preference acc | 1.000 | โ |
Model tree for thesimonharms/mclass
Base model
nreimers/MiniLM-L6-H384-uncased Quantized
sentence-transformers/all-MiniLM-L6-v2