prepare-data
Skill86 starsChanged 10 days agoApache-2.0View on GitHub
Turns raw sports annotations into Hugging Face conversation JSONL train, validation and test splits with the repo's data-prep pipeline for that sport, checks the splits before training, and reports the paths a training recipe needs. Covers tennis (references/tennis.md) and basketball from the public BARD dataset (references/basketball.md). Use when the user asks to generate, regenerate, split or validate sports MCQ/QA training data, choose question templates, run offline or with LLM distractors, or fill dataset paths in a training recipe. Not for launching or monitoring training, running inference, or scoring checkpoints.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Not for: launching, resuming or monitoring training.
- Distinctive: line 50
every split file exists and is non-empty
- Very specific: line 51
every record has a unique id across splits, and one user turn holding both the video and the question, plus an assistant answer
- Very specific: line 52
no train clip appears in an eval split (except splits the guide passes in --train-pool-splits), and no source video of the held-out …
- Very specific: line 67
Hand off to training: Do not launch training here.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Prepare Data
<!--
SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0
-->Produces training-ready split files from sports annotations and checks that they are safe to train on. It never launches training. Run every command from the repository root.
When to Use This Skill
- Generate MCQ/QA splits from the bundled sample annotations or from new annotations in the same format.
- Choose question templates, or offline vs LLM-distractor generation.
- Validate existing split JSONL (schema, ids, clip paths, train/eval leakage) before a training run.
- Fill the dataset fields of an AutoModel or Megatron-Bridge recipe with the generated paths.
Not for: launching, resuming or monitoring training; running inference; scoring checkpoints; obtaining match video the user has no rights to.
Sports
| Sport | Guide | Pipeline |
| Tennis | references/tennis.md | avlm/data_prep_example/tennis/ |
| Basketball (BARD) | references/basketball.md | avlm/data_prep_example/basketball/ |
Workflow
- Pick the sport and open its guide from the table above. If the sport has no guide, stop; to build a pipeline for a new labelled video dataset, follow ONBOARD_NEW_DATASET.md only if the user asks for that.
- Generate the splits by following the sport guide: install, mode, command and expected output. Write to a new directory outside the repo, held in
$DATA_OUT. Follow the sport guide on whether to use an LLM (for example for MCQ distractors). Use one only when the guide calls for it or the user explicitly asks, and the user agrees to send annotation text to an external, billed API. Never print or commit keys. Validate the training-ready split directory (
$SPLITS) with the bundled checker (scripts/validate_splits.py, stdlib only). Use the exact command from the sport guide (prefix, split names and flags):python3 skills/prepare-data/scripts/validate_splits.py \ --splits-dir "$SPLITS" --prefix "<prefix from the sport guide>"Once clips exist, add
--video-root "$VIDEO_ROOT". The training loaders silently drop rows whose clip is missing, so this check matters. Exit code 0 means pass. 1 means a validation failure, with up to tenerror:lines on stderr. 2 means a bad argument or missing directory. It checks:- every split file exists and is non-empty
- every record has a unique
idacross splits, and one user turn holding both the video and the question, plus an assistant answer - no train clip appears in an eval split (except splits the guide passes in
--train-pool-splits), and no source video of the held-outtest_unseen*split appears elsewhere - with
--video-root, every clip exists under that root
The stdout JSON gives per-split
records,clipsandclasses. Quote it in the report.Build clip metadata (real clips only; needs
decord), unless the sport guide says its pipeline writes it. Run once for the train file and once for the validation file, then pointvideo_metadata_pathat the printed*_video_metadata.json:python3 ./avlm/utils/build_video_metadata.py \ --dataset_path "$SPLITS/<train file>" \ --video_root "$VIDEO_ROOT" --workers 8 --output-dir "$DATA_OUT/metadata"Details: "Precompute clip duration and FPS" in the AutoModel SFT guide.
Hand off to training. Do not launch training here. Report these recipe values, as absolute paths resolved with
realpath. They go in the user's*_local.yamlcopy of an AutoModel or Megatron-Bridge recipe underavlm/training/:Recipe field Value dataset.path_or_dataset$SPLITS/<train file>dataset.video_root,validation_dataset.video_root$VIDEO_ROOTdataset.video_metadata_pathtrain *_video_metadata.jsonvalidation_dataset.path_or_dataset,inference_validation.data_path$SPLITS/<validation file>validation_dataset.video_metadata_path(AutoModel recipes only)validation *_video_metadata.jsonMegatron-Bridge recipes also need
jsonl_format: hf, which is already set. Keep the test splits for evaluation only. Sample annotations without videos prove only that the pipeline works; they cannot be used for training.
Output
Report all of the following:
- sport, mode, input dir and training-ready split dir
- the validator JSON (records per split, contamination counts, missing clips)
- skipped points, and any question types that were excluded
- the recipe field values from step 5
Final Checks
- Validator exit code is 0, and both
contaminationcounts are 0. - The sport guide's own checks pass.
- Output is outside the repo, and
git statusshows no changes to tracked sample outputs. - No API key appears in logs, files or the reply.
Troubleshooting
| Symptom | Cause and fix |
Validator contamination: N clips in both train and ... | Split files from different runs were mixed, or were hand-edited. Regenerate all splits in one run. |
Validator N of M clips missing under ... | --video-root does not match the paths in the records. Fix the root, or regenerate with --video-root so missing clips are filtered out. |
Validator N clips escape --video-root | A record uses an absolute path or ... Regenerate with clip paths relative to the video root. |
Validator duplicate id | Records were concatenated twice, or two runs were merged. Regenerate. |
| Sport-specific errors | See the sport guide's troubleshooting table. |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

