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

data-preparation

data-preparation

【数据与研究】Prepare LLM Foundry pretraining, fine-tuning, raw-text, Delta/Databricks, and contrastive-pair data safely.

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

技能说明

GitHub

name: data-preparation description: "Prepare LLM Foundry pretraining, fine-tuning, raw-text, Delta/Databricks, and contrastive-pair data safely." disable-model-invocation: true metadata: disco-role: operating repo-skill: llm-foundry coverage: data-preparation license: Apache 2.0

LLM Foundry data preparation

Use this sub-skill when the user needs to create, validate, inspect, or troubleshoot data for LLM Foundry pretraining, supervised fine-tuning, raw text conversion, Delta/Databricks export, StreamingDataset/MDS consumption, or contrastive-pair dataloaders.

Route first

Scope and boundaries

This sub-skill covers:

  • Public llmfoundry data_prep commands: convert_dataset_hf, convert_dataset_json, convert_finetuning_dataset, convert_text_to_mds, and convert_delta_to_json.
  • MDS/StreamingDataset split layouts, remote/local/split/streams cache fields, max_seq_len, tokenizer/concat choices, safe type handling, and split/cache validation.
  • Pretraining text JSON/JSONL, local JSON, supervised fine-tuning prompt/response and chat schemas, target loss policies, raw text folders, Delta-export JSONL, and contrastive-pair formats.
  • Data-prep API facts for StreamingTextDataset, StreamingFinetuningDataset, build_text_dataloader, build_finetuning_dataloader, and convert_*_from_args wrappers.

Route elsewhere:

  • Training YAML launch details, optimizers, schedulers, callbacks, and checkpointing → training-finetuning.
  • ICL/evaluation task datasets and Eval Gauntlet schemas → evaluation.
  • Model registries, model internals, tokenizer registry extension, and package-wide API details → package-apis-configuration.

Safe operating defaults

  1. Prefer local schema validation before conversion. Use the bundled smoke script to inspect imports/signatures and to validate JSONL keys without downloading models or datasets.
  2. Treat Hugging Face dataset loads, tokenizer loads, remote object stores, and Databricks queries as network/credential operations. Ask before running them unless the user explicitly authorized them.
  3. Keep generated MDS outputs isolated by split, e.g. out_root/train/index.json plus shard files. Do not overwrite non-empty output folders; choose a new output root or clean intentionally.
  4. Keep allow_unsafe_types: false for MDS reading unless the user understands that Pickle-like shard types can execute code during deserialization.
  5. For supervised fine-tuning, default decoder-only target policy is target_prompts: none, target_responses: last; for encoder-decoder it must remain none/last.

Provenance

This sub-skill distills public CLI definitions, data module signatures, data-prep README behavior, installed package facts, and data/tokenizer tests. Runtime instructions are self-contained; no source checkout, review artifact, or local path is required after this skill is loaded.

我的收藏