train-sentence-transformers
Skill0 starsChanged 7 months agoApache-2.0View on GitHub
Guardrail for training sentence-transformers bi-encoders, cross-encoders, and sparse encoders with correct loss, evaluator, hard-negative, and publishing choices.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- PracticalSwan/agent-skillstheir own version, first seen Oct 19, 2026
- waybarrios/opencode-power-packtheir own version, first seen Oct 13, 2026
- huggingface/skillstheir own version, first seen Oct 1, 2026
- huggingface/sentence-transformerstheir own version, first seen Aug 11, 2026
- Adhamxon/claude-code-skillstheir own version, first seen Jul 30, 2026
- noahsilve123/claude-skillsettheir own version, first seen Jul 3, 2026
Used with
Projects with it also use huggingface-datasets.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Hugging FaceSkillhuggingface-datasets
Use this skill for Hugging Face Dataset Viewer API workflows that fetch subset/split metadata, paginate rows, search text, apply filters, download parquet URLs, and read size or statistics.
Also in 3 projects that use this
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- huggingface/sentence-transformers★ 19ksame name
- huggingface/skills★ 11ksame name
- waybarrios/opencode-power-pack★ 547same name
- PracticalSwan/agent-skills★ 22same name
- Adhamxon/claude-code-skills★ 2same name
- noahsilve123/claude-skillset★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository57 other files it gives its agents.
- ai-app-integrationSkill
- anti-llm-frontend-designSkill
- aspnet-core-web-developmentSkill
- async-python-patternsSkill
- browser-game-foundationsSkill
- browser-local-qaSkill
- build-mcp-server-sdk-v2Skill
- canva-design-opsSkill
- check-completionSkill
- cli-tool-creatorSkill
- cloudflare-agents-mcpSkill
- cloudflare-durable-objectsSkill
- cloudflare-workers-platformSkill
- deployment-preview-workflowsSkill
- docx-document-artifactsSkill
- durable-workflow-orchestrationSkill
- dynamic-og-imagesSkill
- eval-auditSkill
- evaluate-ragSkill
- figma-design-to-code-rulesSkill
- fine-tuningSkill
- frontend-product-builderSkill
- game-asset-pipeline-expansionSkill
- game-ui-playtestSkill
- generate-synthetic-dataSkill
- github-pr-ci-opsSkill
- gmail-inbox-opsSkill
- golden-datasetSkill
- huggingface-llm-trainerSkill
- javascript-monorepo-buildsSkill
- linear-issue-managementSkill
- media-generation-transcriptionSkill
- millrace-rs-contract-paritySkill
- minecraft-mod-qa-automationSkill
- notion-workspace-flowsSkill
- openai-docsSkill
- optimize-agentic-cliSkill
- pdf-artifact-workflowSkill
- phaser-2d-game-developmentSkill
- postgres-query-performanceSkill
- product-ui-polish-reviewSkill
- pydantic-v2-patternsSkill
- python-repo-refactoring-hygieneSkill
- rag-corpus-hygieneSkill
- react-next-performance-reviewSkill
- rust-best-practicesSkill
- shadcn-ui-compositionSkill
- skill-evaluation-harnessSkill
- tauri-desktopSkill
- tauri-mcp-cliSkill
- tauri-ptySkill
- tile-pixel-art-transitionsSkill
- typer-cli-patternsSkill
- using-dbt-for-analytics-engineeringSkill
- validate-evaluatorSkill
- visual-asset-pipelineSkill
- watchdog-file-watcher-patternsSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 8 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 37
Do not synthesize a training script from memory when production templates or examples exist.
- Distinctive: line 38
Do not train without baseline evaluation.
- Distinctive: line 39
Do not use cached losses with incompatible gradient-checkpointing settings.
- Distinctive: line 40
Do not use a reranker when first-pass recall is too weak.
- Distinctive: line 41
Do not publish models or cards containing private data.
- Distinctive: line 42
Keep run logs, seeds, model names, data versions, and primary metrics reproducible.
- Distinctive: line 63
Run training and log baseline plus final metrics.
- Distinctive: line 74
Start with model type and data shape.
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Train Sentence Transformers
Purpose
Help agents train or fine-tune sentence-transformers models for retrieval, similarity, reranking, learned sparse retrieval, clustering, classification, paraphrase mining, or deduplication.
Quick Start
- Identify model type: bi-encoder
SentenceTransformer,CrossEncoderreranker, orSparseEncoder. - Match loss function to data shape.
- Choose the evaluator that matches the task and primary metric.
- Smoke-test with a tiny slice before long training.
- Capture baseline score before training and emit an end-of-run verdict.
- Push or publish only after validation.
Operating Constraints
- Do not synthesize a training script from memory when production templates or examples exist.
- Do not train without baseline evaluation.
- Do not use cached losses with incompatible gradient-checkpointing settings.
- Do not use a reranker when first-pass recall is too weak.
- Do not publish models or cards containing private data.
- Keep run logs, seeds, model names, data versions, and primary metrics reproducible.
Inputs This Skill Expects
- Task type and model class.
- Dataset shape: pairs, triplets, query-positive-negative, labels, rankings, or sparse targets.
- Base model, language/domain, hardware, and Hub policy.
- Evaluator and baseline metric.
- Hard-negative mining plan when relevant.
Output Contract
- State model type, loss, evaluator, data shape, metric, and training command.
- Include smoke-test command and baseline evaluation.
- Report verdict: win, marginal, or regression.
- State publish, iterate, or reject decision with metric evidence.
Procedure
- Classify the model type from task wording.
- Inspect dataset columns and labels.
- Choose loss and evaluator from data shape and task.
- Prepare training script/config from a known-good template.
- Run smoke test.
- Run training and log baseline plus final metrics.
- Publish or archive artifacts only after the verdict is acceptable.
Pitfalls And Gotchas
- Choosing a loss that silently mismatches columns or labels.
- Evaluating rerankers with first-pass retrieval metrics.
- Forgetting named-evaluator metric keys.
- Skipping hard-negative quality checks.
- Reporting high scores despite sparse dimension collapse.
Progressive Disclosure
Start with model type and data shape. Expand into hard-negative mining, LoRA, Matryoshka, distillation, multilingual transfer, sparse regularization, or cloud execution only when the training objective needs it.
Verification Pattern
- Confirm model type, loss, evaluator, and metric align.
- Confirm baseline evaluation ran before training.
- Confirm smoke test passed.
- Confirm final verdict compares baseline and trained model.
- Confirm publication respects privacy and artifact policy.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

