[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7D8EEZB8K3T475KAYBVSTGE":3,"skill-same:01M7D8EEZB8K3T475KAYBVSTGE":180},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":25,"commitSha":26,"skillDirectory":5,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7D8EEZB8K3T475KAYBVSTGE","train-sentence-transformers",null,"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 \u002F pair classification), `SparseEncoder` (SPLADE, sparse embedding model for learned-sparse retrieval), and `MultiVectorEncoder` (ColBERT \u002F late-interaction, per-token embeddings scored with MaxSim). Covers loss selection, hard-negative mining, evaluators, distillation, LoRA, Matryoshka, and Hugging Face Hub publishing. Use for any sentence-transformers training task.","tangyixiao\u002Ftangyixiao-skills","tangyixiao","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F115929632?v=4","01M7D582YK6A4M63CAK4CSY4EW","Tang Yixiao","01M7D582Z64DMRSYR872SR34SA",2,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: train-sentence-transformers\ndescription: Train or fine-tune sentence-transformers models across `SentenceTransformer`\n  (bi-encoder, dense or static embedding model for retrieval, similarity, clustering,\n  classification, paraphrase mining, dedup, multimodal), `CrossEncoder` (reranker,\n  pair scoring for two-stage retrieval \u002F pair classification), `SparseEncoder` (SPLADE,\n  sparse embedding model for learned-sparse retrieval), and `MultiVectorEncoder` (ColBERT\n  \u002F late-interaction, per-token embeddings scored with MaxSim). Covers loss selection,\n  hard-negative mining, evaluators, distillation, LoRA, Matryoshka, and Hugging Face\n  Hub publishing. Use for any sentence-transformers training task.\n---\n\n# Train a sentence-transformers Model\n\n**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\u002F` and `scripts\u002F`.\n\n**Do not synthesize a training script from this file alone.** Open the per-type production template (`scripts\u002Ftrain_\u003Ctype>_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.\n\n## 1. Identify the model type\n\n| Tag | Class | What it does | When to pick |\n|---|---|---|---|\n| **[SentenceTransformer]** | `SentenceTransformer` (bi-encoder) | Maps each input to a fixed-dim dense vector | Retrieval, similarity, clustering, classification, paraphrase mining, dedup |\n| **[CrossEncoder]** | `CrossEncoder` (reranker) | Scores `(query, passage)` pairs jointly | Two-stage retrieval (rerank top-100 from bi-encoder), pair classification |\n| **[SparseEncoder]** | `SparseEncoder` (SPLADE) | Sparse vectors over the vocabulary | Learned-sparse retrieval, inverted-index backends (Elasticsearch \u002F OpenSearch \u002F Lucene) |\n| **[MultiVectorEncoder]** | `MultiVectorEncoder` (ColBERT) | One embedding per token, scored with MaxSim | Late-interaction retrieval, recall gains over bi-encoders at higher storage cost, multimodal (ColPali \u002F ColQwen2) |\n\nTiebreakers when the request is ambiguous: \"embedding model\" \u002F \"vector search\" \u002F \"similarity\" → **[SentenceTransformer]**. \"rerank\" \u002F \"ranker\" \u002F \"two-stage\" → **[CrossEncoder]**. \"SPLADE\" \u002F \"sparse\" \u002F \"inverted index\" → **[SparseEncoder]**. \"ColBERT\" \u002F \"late interaction\" \u002F \"multi-vector\" \u002F \"MaxSim\" \u002F \"ColPali\" \u002F \"ColQwen\" → **[MultiVectorEncoder]**. If still unclear, ask.\n\n## 2. Required reading\n\n**Read these in full before writing any code. Do not triage by perceived relevance.**\n\n### Per-type: always required\n\n**[SentenceTransformer]**\n- `references\u002Flosses_sentence_transformer.md`: loss-to-data-shape mapping, `BatchSamplers.NO_DUPLICATES` requirement for MNRL-family, `Cached*` ↔ `gradient_checkpointing` incompatibility.\n- `references\u002Fevaluators_sentence_transformer.md`: evaluator-to-task mapping, `metric_for_best_model` key construction (named vs unnamed), per-evaluator `primary_metric` values.\n- `references\u002Fmodel_architectures.md`: encoder vs decoder vs static vs Router pipelines, pooling rules (mean \u002F cls \u002F lasttoken), auto-mean-pooling behavior for fresh-start MLM bases.\n- `scripts\u002Ftrain_sentence_transformer_example.py`: production template. Copy this as your starting point.\n\n**[CrossEncoder]**\n- `references\u002Flosses_cross_encoder.md`: pointwise \u002F pairwise \u002F listwise \u002F distillation, `pos_weight` derivation, `activation_fn=Identity()` mandatory for non-BCE losses (silent eval-rank collapse otherwise).\n- `references\u002Fevaluators_cross_encoder.md`: `CrossEncoderRerankingEvaluator` recipe, named-evaluator key format `eval_{name}_{primary_metric}`.\n- `scripts\u002Ftrain_cross_encoder_example.py`: production template. Copy this as your starting point.\n\n**[SparseEncoder]**\n- `references\u002Flosses_sparse_encoder.md`: `SpladeLoss` wrapper requirement, FLOPS regularizer weights, smoke-test active-dim ramp behavior.\n- `references\u002Fevaluators_sparse_encoder.md`: `SparseNanoBEIREvaluator` (English-only) and the in-domain alternative, `eval_{name}_{primary_metric}` key format.\n- `scripts\u002Ftrain_sparse_encoder_example.py`: production template. Copy this as your starting point.\n\n**[MultiVectorEncoder]**\n- `references\u002Flosses_multi_vector_encoder.md`: MaxSim scoring, scale choice per scoring mode (`scale=1.0` for MaxSim, roughly the average query length for MeanMaxSim), MNRL \u002F CachedMNRL \u002F MarginMSE \u002F DistillKLDiv, XTR-vs-ColBERT scoring, CachedMNRL ↔ `gradient_checkpointing` incompatibility.\n- `references\u002Fevaluators_multi_vector_encoder.md`: `MultiVectorNanoBEIREvaluator` (English-only) and the in-domain alternative, `eval_NanoBEIR_mean_maxsim_ndcg@10` key format, distillation-eval spearman variant.\n- `scripts\u002Ftrain_multi_vector_encoder_example.py`: production template. Copy this as your starting point.\n\n### Cross-cutting: always required (regardless of task)\n\n- `references\u002Ftraining_args.md`: `TrainingArguments` knobs, precision rules (load fp32 + autocast bf16\u002Ffp16, never `torch_dtype=bfloat16`), `warmup_steps` (float) vs deprecated `warmup_ratio`, `save_steps` must be a multiple of `eval_steps` for `load_best_model_at_end`, schedulers, HPO, tracker, resume, hub-push variants.\n- `references\u002Fdataset_formats.md`: column-matching rules (label name auto-detection, column-order-not-name), reshaping recipes, hard-negative mining options.\n- `references\u002Fbase_model_selection.md`: discovery commands, per-type model namespaces, ModernBERT-family `max_seq_length=8192` trap, `datasets >= 4` script-loader rejection, non-English starting-point shortcuts.\n- `references\u002Ftroubleshooting.md`: symptom-indexed failure recipes. Skim the section headings on every run, even a healthy one. The \"Metrics don't improve\" and \"Hub push fails\" entries cover bugs that bite frequently and are cheaper to recognize before they fire than to debug after.\n\n### Cross-cutting: load when applicable\n\n- `references\u002Fhardware_guide.md`: VRAM sizing, multi-GPU, FSDP \u002F DeepSpeed, HF Jobs flavors. Required for >24GB models, multi-GPU, or HF Jobs runs.\n- `references\u002Fhf_jobs_execution.md`: required when running on HF Jobs.\n- `references\u002Fprompts_and_instructions.md`: required when using prompt-tuned bases (E5, BGE, GTE, Qwen3-Embedding, Instructor, Nomic, etc.) or adding `query: ` \u002F `passage: ` style prefixes.\n\n### Variant scripts (open when the task matches)\n- **[SentenceTransformer]** `scripts\u002Ftrain_sentence_transformer_\u003Cmatryoshka|multi_dataset|with_lora|distillation|make_multilingual|static_embedding>_example.py`.\n- **[CrossEncoder]** `scripts\u002Ftrain_cross_encoder_\u003Cdistillation|listwise>_example.py`.\n- **[SparseEncoder]** `scripts\u002Ftrain_sparse_encoder_distillation_example.py`.\n- Hard-negative mining CLI: `scripts\u002Fmine_hard_negatives.py`.\n\n## 3. Defaults\n\nOverride only if the user specifies otherwise:\n- **Local execution.** Pitch HF Jobs only if local hardware can't fit the job.\n- **Single run.** After it completes, propose experimentation if the user would benefit (weak\u002Fmarginal verdict, \"see how high you can push it\" framing, etc.). Iteration rules in `references\u002Ftraining_args.md` (Experimentation section).\n- **Public Hub push at end-of-run, wrapped in try-except.** On HF Jobs (ephemeral env) ALSO enable in-trainer push (`push_to_hub=True` + `hub_strategy=\"every_save\"`). Details in `references\u002Fhf_jobs_execution.md`.\n\n## 4. Constraints the produced script must satisfy\n\nThese are non-negotiable contracts. Implementation lives in the production templates and references. Do not reinvent.\n\n- Capture the pre-training evaluator score as `baseline_eval` **before** `trainer.train()`.\n- Emit a single end-of-run line: `VERDICT: WIN|MARGINAL|REGRESSION | score=... | baseline=... | delta=...`. A monitor scrapes for this.\n- Silence `httpx`, `httpcore`, `huggingface_hub`, `urllib3`, `filelock`, `fsspec` to WARNING (otherwise HF download URLs flood the agent's context).\n- Tee logs to `logs\u002F{RUN_NAME}.log`.\n- End with `model.push_to_hub(...)` wrapped in `try\u002Fexcept`.\n- Smoke-test before any long run (`max_steps=1` + tiny dataset slice). The production templates show one common pattern (`SMOKE_TEST` env var).\n- **[CrossEncoder]** Include `EarlyStoppingCallback(patience>=3)`. CE rerankers often peak mid-training and regress.\n- **[SparseEncoder]** Log `query_active_dims` \u002F `corpus_active_dims` on the verdict line. High nDCG with collapsed sparsity is not a win. The keys come back name-prefixed (e.g. `..._query_active_dims`). Use suffix matching to pluck them. See the SPARSE production template for the exact pattern.\n- **[MultiVectorEncoder]** Match `scale` to the scoring mode on any MNRL-family loss: near `1.0` for unnormalized MaxSim (do not copy `scale=20.0` from bi-encoder MNRL), roughly the average query length with length-normalized MeanMaxSim, since each score is divided by its query's token count. `XTRScores` is a train-only `similarity_fct`: the evaluators reject it, so evaluation always scores with MaxSim, including for XTR-trained models.\n\n## 5. Workflow\n\n1. Identify the model type (§1). Ask if ambiguous.\n2. Load the §2 required-reading files for that type.\n3. Open `scripts\u002Ftrain_\u003Ctype>_example.py` and copy it as your starting point.\n4. Replace `MODEL_NAME`, `DATASET_NAME`, `RUN_NAME`, the loss, and the evaluator with the user's task. Cross-check loss\u002Fdata-shape match against `references\u002Flosses_\u003Ctype>.md`. Cross-check the `metric_for_best_model` key against `references\u002Fevaluators_\u003Ctype>.md` (named evaluators format the key as `eval_{name}_{primary_metric}`).\n5. Smoke-test (`max_steps=1`).\n6. Run.\n7. After the run, append to `logs\u002Fexperiments.md` and propose iteration if the verdict is weak\u002Fmarginal.\n\n## Prerequisites\n\n```bash\npip install \"sentence-transformers[train]>=5.0\"        # add [train,image] \u002F [audio] \u002F [video] for [SentenceTransformer] multimodal\n                                                       # [MultiVectorEncoder] requires >=6.0\npip install trackio                                    # optional tracker (or wandb \u002F tensorboard \u002F mlflow)\nhf auth login                                          # or set HF_TOKEN with write scope (for Hub push)\n```\n\nGPU strongly recommended. CPU works only for demos and `[SentenceTransformer]` `StaticEmbedding`.\n","# Train a sentence-transformers Model\n\n**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\u002F` and `scripts\u002F`.\n\n**Do not synthesize a training script from this file alone.** Open the per-type production template (`scripts\u002Ftrain_\u003Ctype>_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.\n\n## 1. Identify the model type\n\n| Tag | Class | What it does | When to pick |\n|---|---|---|---|\n| **[SentenceTransformer]** | `SentenceTransformer` (bi-encoder) | Maps each input to a fixed-dim dense vector | Retrieval, similarity, clustering, classification, paraphrase mining, dedup |\n| **[CrossEncoder]** | `CrossEncoder` (reranker) | Scores `(query, passage)` pairs jointly | Two-stage retrieval (rerank top-100 from bi-encoder), pair classification |\n| **[SparseEncoder]** | `SparseEncoder` (SPLADE) | Sparse vectors over the vocabulary | Learned-sparse retrieval, inverted-index backends (Elasticsearch \u002F OpenSearch \u002F Lucene) |\n| **[MultiVectorEncoder]** | `MultiVectorEncoder` (ColBERT) | One embedding per token, scored with MaxSim | Late-interaction retrieval, recall gains over bi-encoders at higher storage cost, multimodal (ColPali \u002F ColQwen2) |\n\nTiebreakers when the request is ambiguous: \"embedding model\" \u002F \"vector search\" \u002F \"similarity\" → **[SentenceTransformer]**. \"rerank\" \u002F \"ranker\" \u002F \"two-stage\" → **[CrossEncoder]**. \"SPLADE\" \u002F \"sparse\" \u002F \"inverted index\" → **[SparseEncoder]**. \"ColBERT\" \u002F \"late interaction\" \u002F \"multi-vector\" \u002F \"MaxSim\" \u002F \"ColPali\" \u002F \"ColQwen\" → **[MultiVectorEncoder]**. If still unclear, ask.\n\n## 2. Required reading\n\n**Read these in full before writing any code. Do not triage by perceived relevance.**\n\n### Per-type: always required\n\n**[SentenceTransformer]**\n- `references\u002Flosses_sentence_transformer.md`: loss-to-data-shape mapping, `BatchSamplers.NO_DUPLICATES` requirement for MNRL-family, `Cached*` ↔ `gradient_checkpointing` incompatibility.\n- `references\u002Fevaluators_sentence_transformer.md`: evaluator-to-task mapping, `metric_for_best_model` key construction (named vs unnamed), per-evaluator `primary_metric` values.\n- `references\u002Fmodel_architectures.md`: encoder vs decoder vs static vs Router pipelines, pooling rules (mean \u002F cls \u002F lasttoken), auto-mean-pooling behavior for fresh-start MLM bases.\n- `scripts\u002Ftrain_sentence_transformer_example.py`: production template. Copy this as your starting point.\n\n**[CrossEncoder]**\n- `references\u002Flosses_cross_encoder.md`: pointwise \u002F pairwise \u002F listwise \u002F distillation, `pos_weight` derivation, `activation_fn=Identity()` mandatory for non-BCE losses (silent eval-rank collapse otherwise).\n- `references\u002Fevaluators_cross_encoder.md`: `CrossEncoderRerankingEvaluator` recipe, named-evaluator key format `eval_{name}_{primary_metric}`.\n- `scripts\u002Ftrain_cross_encoder_example.py`: production template. Copy this as your starting point.\n\n**[SparseEncoder]**\n- `references\u002Flosses_sparse_encoder.md`: `SpladeLoss` wrapper requirement, FLOPS regularizer weights, smoke-test active-dim ramp behavior.\n- `references\u002Fevaluators_sparse_encoder.md`: `SparseNanoBEIREvaluator` (English-only) and the in-domain alternative, `eval_{name}_{primary_metric}` key format.\n- `scripts\u002Ftrain_sparse_encoder_example.py`: production template. Copy this as your starting point.\n\n**[MultiVectorEncoder]**\n- `references\u002Flosses_multi_vector_encoder.md`: MaxSim scoring, scale choice per scoring mode (`scale=1.0` for MaxSim, roughly the average query length for MeanMaxSim), MNRL \u002F CachedMNRL \u002F MarginMSE \u002F DistillKLDiv, XTR-vs-ColBERT scoring, CachedMNRL ↔ `gradient_checkpointing` incompatibility.\n- `references\u002Fevaluators_multi_vector_encoder.md`: `MultiVectorNanoBEIREvaluator` (English-only) and the in-domain alternative, `eval_NanoBEIR_mean_maxsim_ndcg@10` key format, distillation-eval spearman variant.\n- `scripts\u002Ftrain_multi_vector_encoder_example.py`: production template. Copy this as your starting point.\n\n### Cross-cutting: always required (regardless of task)\n\n- `references\u002Ftraining_args.md`: `TrainingArguments` knobs, precision rules (load fp32 + autocast bf16\u002Ffp16, never `torch_dtype=bfloat16`), `warmup_steps` (float) vs deprecated `warmup_ratio`, `save_steps` must be a multiple of `eval_steps` for `load_best_model_at_end`, schedulers, HPO, tracker, resume, hub-push variants.\n- `references\u002Fdataset_formats.md`: column-matching rules (label name auto-detection, column-order-not-name), reshaping recipes, hard-negative mining options.\n- `references\u002Fbase_model_selection.md`: discovery commands, per-type model namespaces, ModernBERT-family `max_seq_length=8192` trap, `datasets >= 4` script-loader rejection, non-English starting-point shortcuts.\n- `references\u002Ftroubleshooting.md`: symptom-indexed failure recipes. Skim the section headings on every run, even a healthy one. The \"Metrics don't improve\" and \"Hub push fails\" entries cover bugs that bite frequently and are cheaper to recognize before they fire than to debug after.\n\n### Cross-cutting: load when applicable\n\n- `references\u002Fhardware_guide.md`: VRAM sizing, multi-GPU, FSDP \u002F DeepSpeed, HF Jobs flavors. Required for >24GB models, multi-GPU, or HF Jobs runs.\n- `references\u002Fhf_jobs_execution.md`: required when running on HF Jobs.\n- `references\u002Fprompts_and_instructions.md`: required when using prompt-tuned bases (E5, BGE, GTE, Qwen3-Embedding, Instructor, Nomic, etc.) or adding `query: ` \u002F `passage: ` style prefixes.\n\n### Variant scripts (open when the task matches)\n- **[SentenceTransformer]** `scripts\u002Ftrain_sentence_transformer_\u003Cmatryoshka|multi_dataset|with_lora|distillation|make_multilingual|static_embedding>_example.py`.\n- **[CrossEncoder]** `scripts\u002Ftrain_cross_encoder_\u003Cdistillation|listwise>_example.py`.\n- **[SparseEncoder]** `scripts\u002Ftrain_sparse_encoder_distillation_example.py`.\n- Hard-negative mining CLI: `scripts\u002Fmine_hard_negatives.py`.\n\n## 3. Defaults\n\nOverride only if the user specifies otherwise:\n- **Local execution.** Pitch HF Jobs only if local hardware can't fit the job.\n- **Single run.** After it completes, propose experimentation if the user would benefit (weak\u002Fmarginal verdict, \"see how high you can push it\" framing, etc.). Iteration rules in `references\u002Ftraining_args.md` (Experimentation section).\n- **Public Hub push at end-of-run, wrapped in try-except.** On HF Jobs (ephemeral env) ALSO enable in-trainer push (`push_to_hub=True` + `hub_strategy=\"every_save\"`). Details in `references\u002Fhf_jobs_execution.md`.\n\n## 4. Constraints the produced script must satisfy\n\nThese are non-negotiable contracts. Implementation lives in the production templates and references. Do not reinvent.\n\n- Capture the pre-training evaluator score as `baseline_eval` **before** `trainer.train()`.\n- Emit a single end-of-run line: `VERDICT: WIN|MARGINAL|REGRESSION | score=... | baseline=... | delta=...`. A monitor scrapes for this.\n- Silence `httpx`, `httpcore`, `huggingface_hub`, `urllib3`, `filelock`, `fsspec` to WARNING (otherwise HF download URLs flood the agent's context).\n- Tee logs to `logs\u002F{RUN_NAME}.log`.\n- End with `model.push_to_hub(...)` wrapped in `try\u002Fexcept`.\n- Smoke-test before any long run (`max_steps=1` + tiny dataset slice). The production templates show one common pattern (`SMOKE_TEST` env var).\n- **[CrossEncoder]** Include `EarlyStoppingCallback(patience>=3)`. CE rerankers often peak mid-training and regress.\n- **[SparseEncoder]** Log `query_active_dims` \u002F `corpus_active_dims` on the verdict line. High nDCG with collapsed sparsity is not a win. The keys come back name-prefixed (e.g. `..._query_active_dims`). Use suffix matching to pluck them. See the SPARSE production template for the exact pattern.\n- **[MultiVectorEncoder]** Match `scale` to the scoring mode on any MNRL-family loss: near `1.0` for unnormalized MaxSim (do not copy `scale=20.0` from bi-encoder MNRL), roughly the average query length with length-normalized MeanMaxSim, since each score is divided by its query's token count. `XTRScores` is a train-only `similarity_fct`: the evaluators reject it, so evaluation always scores with MaxSim, including for XTR-trained models.\n\n## 5. Workflow\n\n1. Identify the model type (§1). Ask if ambiguous.\n2. Load the §2 required-reading files for that type.\n3. Open `scripts\u002Ftrain_\u003Ctype>_example.py` and copy it as your starting point.\n4. Replace `MODEL_NAME`, `DATASET_NAME`, `RUN_NAME`, the loss, and the evaluator with the user's task. Cross-check loss\u002Fdata-shape match against `references\u002Flosses_\u003Ctype>.md`. Cross-check the `metric_for_best_model` key against `references\u002Fevaluators_\u003Ctype>.md` (named evaluators format the key as `eval_{name}_{primary_metric}`).\n5. Smoke-test (`max_steps=1`).\n6. Run.\n7. After the run, append to `logs\u002Fexperiments.md` and propose iteration if the verdict is weak\u002Fmarginal.\n\n## Prerequisites\n\n```bash\npip install \"sentence-transformers[train]>=5.0\"        # add [train,image] \u002F [audio] \u002F [video] for [SentenceTransformer] multimodal\n                                                       # [MultiVectorEncoder] requires >=6.0\npip install trackio                                    # optional tracker (or wandb \u002F tensorboard \u002F mlflow)\nhf auth login                                          # or set HF_TOKEN with write scope (for Hub push)\n```\n\nGPU strongly recommended. CPU works only for demos and `[SentenceTransformer]` `StaticEmbedding`.\n",{"name":5,"description":7},"main","2a870f189175a48c39f5f7e26a6d93b0be9cd13b",0,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills","https:\u002F\u002Ftangyixiao.github.io\u002Ftangyixiao-skills\u002F","https:\u002F\u002Fgithub.com\u002Ftangyixiao","http:\u002F\u002Fwww.sxyz.net\u002F","I am Tang Yixiao, a student in Shaoxing No.1 High School. I am eager to learn on GitHub and contribute my part to this community.","2026-11-11 15:45:59",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add tangyixiao\u002Ftangyixiao-skills --skill train-sentence-transformers",{"tool":40,"command":41},"bunx","bunx skills add tangyixiao\u002Ftangyixiao-skills --skill train-sentence-transformers",{"tool":43,"command":44},"pnpm","pnpm dlx skills add tangyixiao\u002Ftangyixiao-skills --skill train-sentence-transformers","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002FSKILL.md",true,[48,54,58,62,66,70,74,78,82,86,90,94,98,102,106,110,114,118,122,128,132,136,140,144,148,152,156,160,164,168,172,176],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"INSTALL-SOURCE.json","REFERENCE","参考文档",540,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002FINSTALL-SOURCE.json",{"path":55,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":16},"LICENSE","许可证",11357,{"path":59,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Fbase_model_selection.md",7647,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Freferences\u002Fbase_model_selection.md",{"path":63,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fdataset_formats.md",6484,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Freferences\u002Fdataset_formats.md",{"path":67,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fevaluators_cross_encoder.md",5602,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Freferences\u002Fevaluators_cross_encoder.md",{"path":71,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Fevaluators_multi_vector_encoder.md",6734,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Freferences\u002Fevaluators_multi_vector_encoder.md",{"path":75,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fevaluators_sentence_transformer.md",5986,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Freferences\u002Fevaluators_sentence_transformer.md",{"path":79,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Fevaluators_sparse_encoder.md",5024,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Freferences\u002Fevaluators_sparse_encoder.md",{"path":83,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002Fhardware_guide.md",6031,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Freferences\u002Fhardware_guide.md",{"path":87,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Fhf_jobs_execution.md",7279,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Freferences\u002Fhf_jobs_execution.md",{"path":91,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Flosses_cross_encoder.md",9736,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Freferences\u002Flosses_cross_encoder.md",{"path":95,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":96,"sourceHtmlUrl":97},"references\u002Flosses_multi_vector_encoder.md",10723,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Freferences\u002Flosses_multi_vector_encoder.md",{"path":99,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":100,"sourceHtmlUrl":101},"references\u002Flosses_sentence_transformer.md",10980,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Freferences\u002Flosses_sentence_transformer.md",{"path":103,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":104,"sourceHtmlUrl":105},"references\u002Flosses_sparse_encoder.md",5174,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Freferences\u002Flosses_sparse_encoder.md",{"path":107,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":108,"sourceHtmlUrl":109},"references\u002Fmodel_architectures.md",9176,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Freferences\u002Fmodel_architectures.md",{"path":111,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":112,"sourceHtmlUrl":113},"references\u002Fprompts_and_instructions.md",6540,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Freferences\u002Fprompts_and_instructions.md",{"path":115,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":116,"sourceHtmlUrl":117},"references\u002Ftraining_args.md",15388,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Freferences\u002Ftraining_args.md",{"path":119,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":120,"sourceHtmlUrl":121},"references\u002Ftroubleshooting.md",13237,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Freferences\u002Ftroubleshooting.md",{"path":123,"resourceType":124,"resourceTypeDesc":125,"sizeBytes":126,"sourceHtmlUrl":127},"scripts\u002Fmine_hard_negatives.py","SCRIPT","脚本",8460,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Fscripts\u002Fmine_hard_negatives.py",{"path":129,"resourceType":124,"resourceTypeDesc":125,"sizeBytes":130,"sourceHtmlUrl":131},"scripts\u002Ftrain_cross_encoder_distillation_example.py",9412,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Fscripts\u002Ftrain_cross_encoder_distillation_example.py",{"path":133,"resourceType":124,"resourceTypeDesc":125,"sizeBytes":134,"sourceHtmlUrl":135},"scripts\u002Ftrain_cross_encoder_example.py",9232,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Fscripts\u002Ftrain_cross_encoder_example.py",{"path":137,"resourceType":124,"resourceTypeDesc":125,"sizeBytes":138,"sourceHtmlUrl":139},"scripts\u002Ftrain_cross_encoder_listwise_example.py",10411,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Fscripts\u002Ftrain_cross_encoder_listwise_example.py",{"path":141,"resourceType":124,"resourceTypeDesc":125,"sizeBytes":142,"sourceHtmlUrl":143},"scripts\u002Ftrain_multi_vector_encoder_example.py",9017,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Fscripts\u002Ftrain_multi_vector_encoder_example.py",{"path":145,"resourceType":124,"resourceTypeDesc":125,"sizeBytes":146,"sourceHtmlUrl":147},"scripts\u002Ftrain_sentence_transformer_distillation_example.py",12232,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Fscripts\u002Ftrain_sentence_transformer_distillation_example.py",{"path":149,"resourceType":124,"resourceTypeDesc":125,"sizeBytes":150,"sourceHtmlUrl":151},"scripts\u002Ftrain_sentence_transformer_example.py",7722,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Fscripts\u002Ftrain_sentence_transformer_example.py",{"path":153,"resourceType":124,"resourceTypeDesc":125,"sizeBytes":154,"sourceHtmlUrl":155},"scripts\u002Ftrain_sentence_transformer_make_multilingual_example.py",11825,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Fscripts\u002Ftrain_sentence_transformer_make_multilingual_example.py",{"path":157,"resourceType":124,"resourceTypeDesc":125,"sizeBytes":158,"sourceHtmlUrl":159},"scripts\u002Ftrain_sentence_transformer_matryoshka_example.py",7302,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Fscripts\u002Ftrain_sentence_transformer_matryoshka_example.py",{"path":161,"resourceType":124,"resourceTypeDesc":125,"sizeBytes":162,"sourceHtmlUrl":163},"scripts\u002Ftrain_sentence_transformer_multi_dataset_example.py",10115,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Fscripts\u002Ftrain_sentence_transformer_multi_dataset_example.py",{"path":165,"resourceType":124,"resourceTypeDesc":125,"sizeBytes":166,"sourceHtmlUrl":167},"scripts\u002Ftrain_sentence_transformer_static_embedding_example.py",10517,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Fscripts\u002Ftrain_sentence_transformer_static_embedding_example.py",{"path":169,"resourceType":124,"resourceTypeDesc":125,"sizeBytes":170,"sourceHtmlUrl":171},"scripts\u002Ftrain_sentence_transformer_with_lora_example.py",10567,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Fscripts\u002Ftrain_sentence_transformer_with_lora_example.py",{"path":173,"resourceType":124,"resourceTypeDesc":125,"sizeBytes":174,"sourceHtmlUrl":175},"scripts\u002Ftrain_sparse_encoder_distillation_example.py",9655,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Fscripts\u002Ftrain_sparse_encoder_distillation_example.py",{"path":177,"resourceType":124,"resourceTypeDesc":125,"sizeBytes":178,"sourceHtmlUrl":179},"scripts\u002Ftrain_sparse_encoder_example.py",8259,"https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Ftrain-sentence-transformers\u002Fscripts\u002Ftrain_sparse_encoder_example.py",[181,189,198,206,214,222],{"skillNo":182,"name":183,"nameZh":6,"description":184,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":185,"sourceHtmlUrl":186,"categories":187,"keywords":188,"publishedAt":20},"01M7D8JK8FYBFNNAJXWD89CFH7","xlsx","Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like \"the xlsx in my downloads\") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.","https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Fxlsx\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Fxlsx\u002FSKILL.md",[],[],{"skillNo":190,"name":191,"nameZh":6,"description":192,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":193,"licenseFileUrl":194,"sourceHtmlUrl":195,"categories":196,"keywords":197,"publishedAt":20},"01M7D8JG8ERGGQQAMX0DWCG9GR","writing-shape","Writing, exploit: shape raw material into an article, paragraph by paragraph.","MIT","https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Fwriting-shape\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Fwriting-shape\u002FSKILL.md",[],[],{"skillNo":199,"name":200,"nameZh":6,"description":201,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":193,"licenseFileUrl":202,"sourceHtmlUrl":203,"categories":204,"keywords":205,"publishedAt":20},"01M7D8JE672GW3EHSE8EF185M4","writing-fragments","Writing, explore: mine raw fragments, no structure yet.","https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Fwriting-fragments\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Fwriting-fragments\u002FSKILL.md",[],[],{"skillNo":207,"name":208,"nameZh":6,"description":209,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":193,"licenseFileUrl":210,"sourceHtmlUrl":211,"categories":212,"keywords":213,"publishedAt":20},"01M7D8JBK572YDFMND8Q6CEYJW","writing-for-agents","Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.","https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Fwriting-for-agents\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Fwriting-for-agents\u002FSKILL.md",[],[],{"skillNo":215,"name":216,"nameZh":6,"description":217,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":193,"licenseFileUrl":218,"sourceHtmlUrl":219,"categories":220,"keywords":221,"publishedAt":20},"01M7D8J5QPWEXX61EGBKYH73R8","writing-clearly-and-concisely","Use when writing prose humans will read—documentation, commit messages, error messages, explanations, reports, or UI text. Applies Strunk's timeless rules for clearer, stronger, more professional writing.","https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Fwriting-clearly-and-concisely\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Fwriting-clearly-and-concisely\u002FSKILL.md",[],[],{"skillNo":223,"name":224,"nameZh":6,"description":225,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":193,"licenseFileUrl":226,"sourceHtmlUrl":227,"categories":228,"keywords":229,"publishedAt":20},"01M7D8J36YWC8WZS5DK5AH03CD","writing-beats","Writing, exploit; assemble raw material into a journey of beats, grounding each term before a beat leans on it.","https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Fwriting-beats\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Ftangyixiao\u002Ftangyixiao-skills\u002Fblob\u002Fmain\u002Fwriting-beats\u002FSKILL.md",[],[]]