# transformers

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.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 2000 installs · ★ 54652
- Author: K-Dense-AI
- License: LicenseRef-Apache-2.0-license · policy=link-only · description only; the file stays with the author
- Source: https://github.com/K-Dense-AI/scientific-agent-skills/tree/HEAD/skills/transformers/SKILL.md
- Updated: 2026-10-19
- HTML: https://affpapa.org/en/nevibecode/skills/transformers

## What it 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.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add K-Dense-AI/scientific-agent-skills --skill transformers -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/transformers/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/transformers/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add K-Dense-AI/scientific-agent-skills --skill transformers -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/transformers/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add K-Dense-AI/scientific-agent-skills --skill transformers -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/transformers/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install K-Dense-AI/scientific-agent-skills transformers
```

2. **Manually: put the files in place**
- File: `.github/skills/transformers/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add K-Dense-AI/scientific-agent-skills --skill transformers -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/K-Dense-AI/scientific-agent-skills --path skills/transformers
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/transformers/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add K-Dense-AI/scientific-agent-skills --skill transformers -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/K-Dense-AI/scientific-agent-skills/tree/HEAD/skills/transformers/SKILL.md

## When to use it
- 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
- Load `Qwen/Qwen2.5-1.5B` and generate a continuation for my prompt
- Set up a sentiment classification pipeline with `distilbert-base-uncased-finetuned-sst-2-english`
- Configure `TrainingArguments` and fine-tune the model on my dataset

## Similar
- [skill-creator](https://affpapa.org/en/nevibecode/skills/skill-creator.md) — skill · 414180 installs
- [writing-for-agents](https://affpapa.org/en/nevibecode/skills/writing-for-agents.md) — skill · 466719 installs
- [media-use](https://affpapa.org/en/nevibecode/skills/media-use.md) — skill · 1100000 installs
- [mcp-builder](https://affpapa.org/en/nevibecode/skills/mcp-builder.md) — skill · 130949 installs
- [subagent-driven-development](https://affpapa.org/en/nevibecode/skills/subagent-driven-development.md) — skill · 237746 installs
- [orchestration](https://affpapa.org/en/nevibecode/skills/orchestration.md) — skill · 349800 installs

From the same set: [k-dense-ai/scientific-agent-skills](https://affpapa.org/en/nevibecode/by/k-dense-ai/scientific-agent-skills.md) — 159 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
