omgskills Get the Mac app
Skill

train-sentence-transformers

@huggingface 19k stars Updated 2026-07-27 Author match: High

Train or fine-tune sentence-transformers models across `SentenceTransformer` (bi-encoder; dense or static embedding model; for retrieval, similarity, clustering, classification, paraphrase mining, dedup, multimodal), `CrossEncoder` (reranker; pair scoring for two-stage retrieval / pair classification), and `SparseEncoder` (SPLADE, sparse embedding model; for learned-sparse retrieval). Covers loss selection, hard-negative mining, evaluators, distillation, LoRA, Matryoshka, and Hugging Face Hub publishing. Use for any sentence-transformers training task.

Install

Install this Claude and Codex skill with the command below. The command stays visible even when copy support is unavailable.

Install command
git clone https://github.com/huggingface/sentence-transformers /tmp/sentence-transformers && ln -s /tmp/sentence-transformers/skills/train-sentence-transformers ~/.claude/skills/train-sentence-transformers

View on GitHub

From README

Train a sentence-transformers Model This SKILL.md is a router, not a manual. It tells you which references and example scripts to load for your task. The actual content — recommended losses, evaluators, training-script structure, model selection, training-arg knobs, troubleshooting — lives in references/ and scripts/. Do not synthesize a training script from this file alone. Open the per-type production template (scripts/train example.py) and copy it as your starting point. The templates contain load-bearing scaffolding (autocast helper, model-card class, logger silencing list, force=True, seed, TF32, version-compatible imports, named-evaluator metric handling) that prior agent runs have repeatedly missed when rolling their own from a synthesized snippet.

More skills