transformers — Claude Code skill: Hugging Face models and training
A skill that walks your agent through Hugging Face Transformers: pulling checkpoints from the Hub, running pipeline inference, generating text and fine-tuning with Trainer.
npx skills add K-Dense-AI/scientific-agent-skills --skill transformers -a claude-codeWhat transformers does
The skill covers Transformers 5.18.0 and gives the agent a reference for loading Hub checkpoints, quick inference through pipeline, text generation with decoding controls, and fine-tuning on custom data via Trainer and TrainingArguments. It spans NLP, vision, audio and multimodal work.
Check your setup first. Python 3.10+, PyTorch 2.5+ and network access for Hub downloads are required. Keep the stack in its own environment: the pinned set is transformers[torch]==5.18.0, torch==2.14.1, datasets==5.0.1, accelerate==1.15.0, peft==0.21.2. Bumping packages one at a time breaks the combination — Datasets 5.0.1 needs Hub below 2, so a newer Hub makes the training stack unsatisfiable. Audio preprocessing pulls in librosa 1.0.0, which needs Python 3.12+.
Gated and private checkpoints need a Hugging Face token, either through hf auth login or the HF_TOKEN variable. Pick the narrowest scope that works: read for downloads, write only when you upload. Version 5 dropped the TensorFlow and JAX backends, and several pipeline tasks such as summarization and question-answering are gone — those need direct task models instead.
What it helps with
- load a checkpoint from the Hugging Face Hub and run inference
- build a text or image classification pipeline
- tune text generation with temperature, top-k and top-p
- fine-tune a model on a custom dataset with Trainer
- figure out which PyTorch and datasets versions fit together
Example prompts for the agent
- Load
Qwen/Qwen2.5-1.5Band generate a continuation for my prompt - Set up a sentiment classification pipeline with
distilbert-base-uncased-finetuned-sst-2-english - Configure
TrainingArgumentsand fine-tune the model on my dataset
How to install transformers
1Skills CLI (Vercel)
npx skills add K-Dense-AI/scientific-agent-skills --skill transformers -a claude-code2Manually: put the files in place
~/.claude/skills/transformers/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/transformers/
1Skills CLI (Vercel)
npx skills add K-Dense-AI/scientific-agent-skills --skill transformers -a codex2Manually: put the files in place
.agents/skills/transformers/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add K-Dense-AI/scientific-agent-skills --skill transformers -a cursor2Manually: put the files in place
.cursor/skills/transformers/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install K-Dense-AI/scientific-agent-skills transformers2Manually: put the files in place
.github/skills/transformers/SKILL.md1Skills CLI (Vercel)
npx skills add K-Dense-AI/scientific-agent-skills --skill transformers -a gemini-cli2Platform CLI
gemini skills install https://github.com/K-Dense-AI/scientific-agent-skills --path skills/transformersManually: put the files in place
.devin/skills/transformers/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add K-Dense-AI/scientific-agent-skills --skill transformers -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about transformers
How do I install transformers in Claude Code?
Run npx skills add K-Dense-AI/scientific-agent-skills --skill transformers -a claude-code. The skill lands in ~/.claude/skills/transformers/SKILL.md.
What does the transformers skill do?
It guides the agent through Hugging Face Transformers: loading Hub models, pipeline inference, text generation and Trainer fine-tuning.
What do I need before using it?
Python 3.10+, PyTorch 2.5+ and network access to download models. Gated checkpoints also need a Hugging Face token via hf auth login or HF_TOKEN.