技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
fine-tuning【数据与研究】Route supervised fine-tuning, DeepSpeed, LoRA, data preprocessing, and post-training loading for Baichuan2-7B-Base.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when the task is to prepare, explain, validate, or launch supervised fine-tuning for Baichuan2-7B-Base. It covers the training data format, the bundled supervised trainer, DeepSpeed ZeRO-3 launch structure, multi-machine hostfiles, LoRA toggling, and how to load the saved fine-tuned result.
Do not use this sub-skill for inference demos, chat APIs, quantized loading, or CPU deployment. Route those tasks to the appropriate inference or deployment guidance instead.
references/workflows.md.references/data-format.md.ds_config interpretation, read references/deepspeed-config.md.references/installation.md.references/troubleshooting.md.scripts/validate_training_data.py: validates Belle-style multi-turn JSON, can write a tiny fixture, and can optionally estimate token truncation with a Baichuan tokenizer.scripts/train_supervised.py: self-contained supervised trainer adapted for Baichuan2-7B-Base with schema validation, dry-run mode, DeepSpeed config generation, and LoRA options.baichuan-inc/Baichuan2-7B-Base, not asking for inference or quantized deployment.target_modules=W_pack unless the model architecture has been intentionally changed.TrainingArguments flags.hostname slots=N line per node.AutoModelForCausalLM.from_pretrained(...); load LoRA adapter output with peft.AutoPeftModelForCausalLM.from_pretrained(...).Before launching training, prefer:
python scripts/validate_training_data.py \
--data_path /path/to/train.json \
--model_max_length 512
python scripts/train_supervised.py \
--dry_run True \
--data_path /path/to/train.json \
--model_name_or_path baichuan-inc/Baichuan2-7B-Base \
--output_dir /path/to/output \
--model_max_length 512
Only move from dry-run validation to DeepSpeed training when dependencies, CUDA visibility, hostfile formatting, and data schema all pass.