Skip to content
Back to skills

Data Preparation

ASecurity

"Validate and prepare XTuner SFT, MLLM, pretraining, and RL JSONL

  • 247 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 9, 2026
toolspythonbashbackend

Works with

  • cli

Security analysis

A100/100

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

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill data-preparation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Data Preparation?

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

Security grade badge for Data Preparation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-data-preparation-eda6de47/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-data-preparation-eda6de47)

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: data-preparation
description: "Validate and prepare XTuner SFT, MLLM, pretraining, and RL JSONL
  data, tokenizer/chat-template configuration, caching, packing, and local
  conversion workflows."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# XTuner data-preparation operating skill

Use this sub-skill when the task is about XTuner V1 dataset records, JSONL validation, tokenizer/chat-template selection, dataset caching, packing, or safe local data conversion before training.

## Route here

- Validate OpenAI-style SFT JSONL, including bare message-list lines and object lines with `messages` or `dialogs`.
- Validate multimodal SFT/pretraining JSONL with image/video references, `media_root`, and `class_name="VLMJsonlDataset"`.
- Validate RL/GSM8K-style reward JSONL with `prompt`, `data_source`, and `reward_model.ground_truth`.
- Choose or document `DatasetConfig`, `DataloaderConfig`, `OpenaiTokenizeFunctionConfig`, and `FTDPTokenizeFnConfig` fields.
- Explain dataset cache behavior (`cache_dir`, `cache_tag`) and packing choices (`pack_level`, preset pack/sampler files).
- Convert local GSM8K `question`/`answer` files into XTuner RL JSONL without network access.

## Route elsewhere

- Training launch commands, torchrun resources, FSDP/checkpoint/resume, and training logs belong to the training sub-skill.
- RL trainer, rollout, Ray, judger service, advantage, replay buffer, and inference-backend configuration belong to the reinforcement-learning sub-skill.
- Model family, tokenizer/model path validity, dense/MoE/VLM backend, attention, FP8, or optional accelerator choices belong to the model-backends sub-skill.
- Legacy preprocess CLI usage belongs to the cli-and-tools sub-skill unless only schema context is needed here.

## Start with the safe local helpers

```bash
python ./scripts/validate_xtuner_jsonl.py ./data/openai_sft.jsonl --mode sft
python ./scripts/validate_xtuner_jsonl.py ./data/mllm.jsonl --mode mllm --media-root ./media
python ./scripts/convert_gsm8k_jsonl.py --input-dir ./gsm8k_raw --out-dir ./gsm8k_xtuner
python ./scripts/validate_xtuner_jsonl.py ./gsm8k_xtuner/train.jsonl --mode rl
```

The bundled scripts use only the Python standard library. They do not import XTuner, a tokenizer, PyTorch, image libraries, or any original repository checkout.

## References to load

- [`references/data-formats.md`](references/data-formats.md): SFT, MLLM, pretraining, RL/GSM8K JSONL schemas and config snippets.
- [`references/tokenization-and-packing.md`](references/tokenization-and-packing.md): chat templates, tokenization configs, cache invalidation, and packing/sampler options.
- [`references/troubleshooting.md`](references/troubleshooting.md): failure signatures and fixes for JSONL, media, truncation, cache, preset packing, and RL reward fields.

## Operating rules

1. Validate JSONL before proposing a training launch.
2. For multimodal data, always resolve local image/video references with an explicit `media_root` and fail fast on missing files.
3. Treat the validator's `--max-length` output as an approximation only; real truncation depends on the selected tokenizer and chat template.
4. When `pack_level="preset"`, ensure both `pack_config_path` and `sampler_config_path` are set before handing off to training.
5. For RL data, `reward_model.ground_truth` is required for GSM8K-style rule reward; do not hand off RL data with missing or empty ground truth.

Files in this skill

  • SKILL.md3.4 KB
  • references/data-formats.md6.6 KB
  • references/tokenization-and-packing.md6.7 KB
  • references/troubleshooting.md5 KB
  • scripts/convert_gsm8k_jsonl.py10.7 KB
  • scripts/validate_xtuner_jsonl.py17.5 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.