executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
training-and-evaluationUse for ModelScope trainer construction, TrainingArgs conversion, fine-tuning and evaluation preflight, checkpoint hooks, and safe train/eval command planning.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this sub-skill when a task asks to train, fine-tune, evaluate, configure, or preflight a ModelScope training job. It focuses on package-level trainer APIs and safe planning. It does not perform long-running training, download models or datasets, or verify broad CUDA/domain recipes by itself.
build_trainer(name, default_args) or an EpochBasedTrainer-style workflow.train, evaluation, optimizer, LR scheduler, hooks, checkpointing, or distributed launch.modelscope.tools.train or modelscope.tools.eval command shape.../pipelines-and-models/SKILL.md.MsDataset.load, local dataset recipes, config file parsing, or file IO details, read ../datasets-config/SKILL.md first, then return here for trainer wiring.../hub-and-cli/SKILL.md.../serving-export-and-tools/SKILL.md.../customization-and-development/SKILL.md.references/workflows.md for safe end-to-end training/evaluation recipes, preflight checklists, API and real-job CLI command shapes.references/training-args-reference.md for TrainingArgs, parse_cli, to_config, config-node mapping, flattened optimizer/LR scheduler values, and dataset column mapping details.references/troubleshooting.md for symptoms, likely causes, and recovery steps for trainer construction, data/config errors, checkpoints, distributed launch, and optional GPU/domain failures.scripts/build_training_args_preview.py --help to inspect the bundled safe preview tool. The helper parses TrainingArgs-style flags and prints the effective config summary without importing ModelScope, downloading models, reading datasets, writing files, or launching training.from modelscope.trainers import build_trainer
kwargs = dict(
model="local-model-dir-or-trusted-model-id",
train_dataset=train_dataset,
eval_dataset=eval_dataset,
max_epochs=1,
work_dir="./work_dir",
)
trainer = build_trainer(name="trainer", default_args=kwargs)
trainer.train()
metrics = trainer.evaluate()
Important safety notes:
build_trainer accepts name='trainer' and default_args=None by default; task-specific trainers use registered names such as NLP, CV, audio, or multi-modal trainer ids.trainer.train() and trainer.evaluate() are real execution calls. Do not run them as a harmless smoke test.These commands are documented here only so an agent can recognize or prepare them. They launch real jobs and can download models, allocate GPUs, read datasets, and write checkpoints/logs.
python -m modelscope.tools.train CONFIG_PATH TRAINER_NAME
python -m modelscope.tools.eval CONFIG_PATH --trainer_name TRAINER_NAME --checkpoint_path CHECKPOINT_PATH
Before using either command, complete the preflight in references/workflows.md and preview TrainingArgs-derived config with the bundled helper when the job is being constructed from flags.
This sub-skill distills public behavior from the README training example, trainer builder and trainer implementation, TrainingArgs and CLI argument parser implementation, hook/checkpoint/distributed trainer modules, train/eval tool modules, representative PyTorch finetuning examples, the TrainingArgs unit test, and repository developer test-level guidance. Source paths are evidence only; future agents should use the bundled references and helper instead of reopening the original checkout.