Agent skill · nvidia
nvflare-convert-huggingface
Convert existing Hugging Face Transformers Trainer or TRL SFTTrainer training code into an NVFLARE federated job using flare.patch(trainer), local validation, and job export; use when the user names Hugging Face or preliminary source inspection identifies one Hugging Face owner, and not for manual PyTorch loops, Lightning, inference-only pipelines, deployment, or experiment workflows.
What it needs
About 6k tokens when loaded.
What this skill does
NVFLARE Convert Hugging Face Use When Use when converting training code built around transformers.Trainer, Seq2SeqTrainer, TRL SFTTrainer, or another Trainer subclass. Support full-model and PEFT/LoRA fine-tuning, datasets/tokenizers, Trainer callbacks and metrics, checkpoint continuity, and replicated torch.distributed training. Do Not Use When Do not use for an AutoModel driven by a manual PyTorch loop without a Hugging Face Trainer (route to nvflare-convert-pytorch), PyTorch Lightning (route to nvflare-convert-lightning, including Lightning modules that contain Transformers models), inference-only pipelines, model serving, failed jobs (route to nvflare-diagnose-job), or federated statistics without training (route to nvflare-fed-stats). Route a project with active Lightning and Hugging Face Trainer entrypoints to nvflare-orient to select one training-loop owner or separate jobs. Route unresolved Trainer ownership, such as a Trainer factory without a bound owner call, to nvflare-orient; do not patch either Trainer. Out of scope: DeepSpeed, FSDP, production/POC deployment, controller rewrites, experiment search, and privacy-protection requests such as HE, encrypted aggregation, differential privacy, or privacy filters; never substitute an unprotected recipe or present a disclaimer as implementation. If a request combines federated statistics and model-training conversion, treat it as two independent jobs and workflows: do not merge or automatically chain them, do not route the combination to nvflare-orient, and ask which workflow to run first before generating or running either job. Recommend nvflare-fed-stats first only when the user's purpose is to understand data distribution; handle conversion later as a separate request. Available Scripts Script Purpose Arguments --- --- --- scripts/resolvemodelsnapshot.py Resolve a local or Hub model/dataset snapshot and emit JSON evidence. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills nvidia/nvflare-convert-huggingface