Sign in
Explore
Skills · SkillData & AIMachine learningLLM apps & RAGReviewedMakes network calls

train-sentence-transformers

Trains and fine-tunes sentence-transformers models: bi-encoder embeddings, CrossEncoder rerankers and SparseEncoder models.

Kind
Skill
Works with
Claude Code
Source
Hugging Face Skills @ 25910b3d0ba3
Path
skills/train-sentence-transformers/SKILL.md
Jobs
Implementation
Topics
Machine learning, LLM apps & RAG

Credit

Made by
huggingface
Original
github.com/huggingface/skills/blob/25910b3d0ba31a2ba102f901cd…
License
Apache-2.0

Listed by Skill Manifest; not made by us.

InstallInstall it by hand, following the source.
hf skills add train-sentence-transformers
Install factsScanned 2 Nov 2026
Adds
  • .claude/skills/train-sentence-transformers/ (the skill folder)
  • 27 file(s) the skill refers to
Runs scripts
Yes
  • shell block in the text
Uses the network
Yes
  • downloads Python packages
Needs secrets
Yes
  • HF_TOKEN
Reads environment variables
  • HF_TOKEN
Source revision
25910b3d0ba3
Licence
Apache-2.0
Last activity
30 Oct 2026
Review
Reviewed

Found by a static scan of the stored text; nothing is run. “None found” is not a guarantee, so read what you install before you run it.

  • Only the main file is read; other files in the folder are not scanned
# 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_<type>_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.

## 1. Identify the model type

| Tag | Class | What it does | When to pick |
|---|---|---|---|
| **[SentenceTransformer]** | `SentenceTransformer` (bi-encoder) | Maps each input to a fixed-dim dense vector | Retrieval, similarity, clustering, classification, paraphrase mining, dedup |
…