Skip to content
Back to skills

Train And Merge

ASecurity

"Routes Chinese-LLaMA-Alpaca-2 dataset prep, training, and LoRA

  • 247 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 8, 2026
toolsshell

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill train-and-merge --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Train And Merge?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Train And Merge
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-train-and-merge/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-train-and-merge)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: train-and-merge
description: "Routes Chinese-LLaMA-Alpaca-2 dataset prep, training, and LoRA
  merge workflows."
metadata:
  disco-role: operating
disable-model-invocation: true
license: Apache 2.0
---

# train-and-merge

Use this sub-skill for any workflow that prepares training data, runs pretraining or supervised fine-tuning, or merges LoRA adapters back into a full model.

## Use it when

- the user mentions `build_dataset.py`, `run_clm_pt_with_peft.py`, `run_clm_sft_with_peft.py`, `run_pt.sh`, or `run_sft.sh`
- the task is about JSON instruction data with `instruction`, `input`, and `output` fields
- the user needs DeepSpeed stage-2 configuration or PEFT/LoRA launch flags
- the task is merging Chinese-LLaMA/Alpaca LoRA weights into HF or PTH outputs

## Workflow

1. Read `references/workflows.md` for the accepted data schema and training flag map.
2. Check that the command is being run from `scripts/training/` so the bundled vendored `peft/` package is importable.
3. Validate the dataset or model-path assumptions before starting any expensive job.
4. Use the shell launchers for a quick example of the expected DeepSpeed and LoRA arguments.
5. Read `references/troubleshooting.md` if the run fails on imports, dataset layout, or adapter merging.

## Bundled runtime files

- `scripts/training/build_dataset.py`
- `scripts/training/run_clm_pt_with_peft.py`
- `scripts/training/run_clm_sft_with_peft.py`
- `scripts/training/run_pt.sh`
- `scripts/training/run_sft.sh`
- `scripts/training/ds_zero2_no_offload.json`
- `scripts/training/peft/`
- `scripts/training/build_dataset.py` also supplies the collator and dataset cache logic used by SFT
- `scripts/merge_llama2_with_chinese_lora_low_mem.py` for LoRA merge/export when a full checkpoint is needed

## What to read first

- `references/workflows.md` for the training data layout and command family
- `references/troubleshooting.md` for local `peft`, DeepSpeed, bitsandbytes, and dataset errors

## Routing notes

- Use this sub-skill before the inference sub-skill when a task needs a freshly trained or merged checkpoint.
- The fine-tuning scripts are intentionally adapter-heavy; do not replace them with a generic Hugging Face recipe unless the user explicitly asks for a rewrite.
- The vendored `peft/` package is part of this sub-skill's runtime surface, not a separate external repository.

Files in this skill

  • SKILL.md2.3 KB
  • references/troubleshooting.md1.4 KB
  • references/workflows.md2.2 KB
  • scripts/merge_llama2_with_chinese_lora_low_mem.py15 KB
  • scripts/training/build_dataset.py3.9 KB
  • scripts/training/ds_zero2_no_offload.json686 B
  • scripts/training/peft/__init__.py1.6 KB
  • scripts/training/peft/mapping.py5.5 KB
  • scripts/training/peft/peft_model.py42.7 KB
  • scripts/training/peft/tuners/__init__.py1 KB
  • scripts/training/peft/tuners/lora.py32.6 KB
  • scripts/training/peft/tuners/p_tuning.py6.5 KB
  • scripts/training/peft/tuners/prefix_tuning.py3.6 KB
  • scripts/training/peft/tuners/prompt_tuning.py4.7 KB
  • scripts/training/peft/utils/__init__.py1.2 KB
  • scripts/training/peft/utils/adapters_utils.py730 B
  • scripts/training/peft/utils/config.py6.4 KB
  • scripts/training/peft/utils/other.py3.7 KB
  • scripts/training/peft/utils/save_and_load.py3.2 KB
  • scripts/training/run_clm_pt_with_peft.py31.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.