界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
数据与研究 · SKILL.md

fine-tuning

fine-tuning

【数据与研究】Prepare FlagEmbedding fine-tuning data and safe training commands for embedders and rerankers.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: fine-tuning description: "Prepare FlagEmbedding fine-tuning data and safe training commands for embedders and rerankers." disable-model-invocation: true metadata: disco-role: operating license: MIT

Fine-Tuning

Use this sub-skill when the task is to prepare or validate FlagEmbedding fine-tuning data, choose the correct training module for an embedder or reranker, or build a bounded torchrun command without launching training automatically.

Read first:

  • references/data-formats.md for JSONL schemas, hard negatives, teacher scores, prompt, and embedder ICL type handling.
  • references/training-commands.md for module entry points, command patterns, DeepSpeed config shapes, LoRA flags, flash-attn caveats, and bge-m3 unified fine-tuning.
  • references/troubleshooting.md when JSONL validation, optional finetune extras, CUDA, DeepSpeed, flash-attn, cache/token, OOM, or distributed launch issues appear.

Bundled helpers:

  • scripts/validate_train_jsonl.py validates embedder or reranker JSONL before training. Use --knowledge-distillation only when score fields are intended for KD.
  • scripts/split_jsonl_by_text_length.py splits JSONL by safe character or token-estimate length without downloading tokenizers.

Route away:

  • Inference-only model loading, encoding, reranking, and score computation belongs to sibling inference.
  • Post-training retrieval, reranking, MTEB, BEIR, or custom benchmark work belongs to sibling evaluation.
  • Broad package installation, import failures, and backend setup outside fine-tuning belongs to the root troubleshooting reference.

Operational constraints:

  • Do not run full training unless the user explicitly asks for it and model, data, devices, caches, output directory, and runtime budget are clear.
  • Treat hard-negative mining and teacher-score generation as model-loading workflows with network/cache/device dependencies unless every model artifact is already local.
  • The optional FlagEmbedding[finetune] extra adds DeepSpeed and flash-attn, but full GPU training and flash-attn compatibility were not verified by this sub-skill.
我的收藏