transformers
Skill by K-Dense-AI
Guides an AI assistant through Hugging Face Transformers for loading Hub models, running pipeline inference, text generation, and Trainer fine-tuning. Aimed at developers working on NLP, vision, audio, and multimodal tasks.
Install transformers
Built from the published package, never by AI.
git clone --depth 1 https://github.com/K-Dense-AI/scientific-agent-skills /tmp/scientific-agent-skills && mkdir -p ~/.claude/skills && cp -r /tmp/scientific-agent-skills/skills/transformers ~/.claude/skills/transformersRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/K-Dense-AI/scientific-agent-skills /tmp/scientific-agent-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/scientific-agent-skills/skills/transformers ~/.gemini/antigravity-cli/skills/transformersAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The Transformers skill gives an AI assistant guidance on the Hugging Face Transformers library, which provides access to pre-trained models for NLP, computer vision, audio, and multimodal tasks. It covers loading models from the Hub, running pipeline inference, text generation, tokenization, and fine-tuning with the Trainer API. The skill targets Transformers 5.18.0 and is PyTorch-only.
Authentication guidance covers gated and private Hub models through hf auth login or HF_TOKEN, and it advises the narrowest token scope that works. The source notes that its examples use illustrative Hub checkpoints, and that verification used tiny random models and local save and reload only. It is intended for developers and researchers building NLP, vision, audio, or multimodal workflows, and it includes a research validation section on recording versions, splits, and seeds.
Written from the project's SKILL.md and checked against it.
What it can do
- Pipeline inferenceRuns quick inference across tasks such as text generation, classification, NER, and image classification.
- Model loadingLoads Hub models with control over configuration, device placement, and precision.
- Text generationCovers greedy, beam search, and sampling strategies with temperature, top-k, and top-p.
- Chat formattingFormats chat messages with a checkpoint's tokenizer.apply_chat_template.
- Fine-tuningFine-tunes models with the Trainer API and TrainingArguments.
- TokenizationExplains padding, truncation, and special token handling for model inputs.
- Hub authenticationExplains setting up an HF token with hf auth login or HF_TOKEN for gated models.
What you need
- Python 3.10 or newer
- PyTorch 2.5 or newer
- transformers 5.18.0
- Network access for Hub downloads
- Hugging Face token for gated or private models
Try asking
- Load a Hugging Face model and run text classification on a sentence
- Fine-tune a Transformers model on my dataset with Trainer
- Format chat messages with apply_chat_template for an instruct model
Good to know
- Transformers v5 is PyTorch-only; TensorFlow and JAX backends were removed.
- Several v5 pipelines were removed, including question-answering and summarization.
- Hub pretrained examples are illustrative; no weights or datasets were downloaded in verification.
- Optional export, distributed, and hardware paths are source-checked, not end-to-end tested.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/transformers/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
Allowed tools: Read Write Edit Bash
-
SKILL.md11 KB -
references/generation.md11 KB -
references/models.md11 KB -
references/pipelines.md12 KB -
references/review.md8 KB
Show all 7 files
-
references/tokenizers.md11 KB -
references/training.md15 KB
Alternatives to transformers
All alternatives →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
Compare with agent-reproduce-align, google_contacts or m06-error-handling
transformers: common questions
Does this skill require PyTorch?
Yes. The source says Transformers v5 is PyTorch-only, and the TensorFlow and JAX backends were removed.
How do I use gated Hugging Face models?
Accept the model license on the Hub and authenticate with hf auth login or HF_TOKEN. The source recommends a read-scoped token for private or gated downloads.
Which pipelines were removed in Transformers v5?
The source lists question-answering, summarization, translation, text2text-generation, image-to-text, and visual-question-answering pipelines as removed.
How do I install transformers?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is transformers free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is transformers safe to use?
It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to transformers?
Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.
