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

ptuning

ptuning

【数据与研究】Guides ChatGLM2-6B P-Tuning v2, chat fine-tuning data, prediction commands, prefix/full checkpoint loading, and optional DeepSpeed fine-tuning.

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

技能说明

GitHub

name: ptuning description: "Guides ChatGLM2-6B P-Tuning v2, chat fine-tuning data, prediction commands, prefix/full checkpoint loading, and optional DeepSpeed fine-tuning." disable-model-invocation: true metadata: disco-role: operating license: NOASSERTION

ChatGLM2-6B P-Tuning and Fine-Tuning

Use this route when the task involves P-Tuning v2, chat fine-tuning data, ADGEN-style data, bundled P-Tuning runner arguments, prefix checkpoint loading, prediction, or optional full-parameter DeepSpeed fine-tuning. Use chat-and-demos for ordinary base-model chat and api-serving when a prepared model should be served.

Safe workflow

  1. Validate data before launching torchrun: python sub-skills/ptuning/scripts/validate_ptuning_data.py --file train.json --format chat --history-column history.
  2. Build a command string without executing it from the generated skill root: python sub-skills/ptuning/scripts/build_ptuning_command.py train --train-file train.json --validation-file dev.json --output-dir output/run.
  3. Confirm model weights/cache, CUDA availability, and the intended checkpoint type. P-Tuning v2 saves a prefix encoder, not a full model; full fine-tuning checkpoints load differently.
  4. Run expensive training/evaluation only after checking data columns, pre_seq_len, quantization, GPU memory, and output paths.

Read data-formats.md for ADGEN/chat schemas, command-templates.md for launch patterns, checkpoint-workflows.md for prefix vs full checkpoints, and troubleshooting.md for schema, OOM, DeepSpeed, quantization, and Gradio issues.

Boundaries

This sub-skill distills the repository's P-Tuning scripts into bundled references, validators, command builders, and a bundled runner under scripts/ptuning_runner/. It does not train or evaluate as a smoke test, does not download ADGEN/model weights, and does not make DeepSpeed a required dependency. Full training, prediction, and web demo launch are GPU/model/data dependent and should be treated as deliberate runtime actions, not verification shortcuts.

我的收藏