AI agents now fine-tune SetFit classifiers from a few dozen examples on HF Jobs

tomaarsen · x · 2026-09-08

Daniel van Strien shares a practical recipe: SetFit trains small text classifiers from only a few labeled examples per class, and you can hand the examples plus the recipe to an AI agent to train and evaluate the classifier automatically on Hugging Face Jobs.

The accompanying uv-scripts/classification dataset ships full scripts (train-classifier.py, train-setfit.py), covering both standard encoder fine-tuning and few-shot SetFit, with notes on picking longer-context bodies, pair-count blowup with many classes, and a worked real-world failure case. tomaarsen endorses using AI to orchestrate training of domain-specific encoders this way.

Original post →

More from coding & agent

coding & agent channel →