alterlab-transformers
Installation
SKILL.md
Transformers
Overview
Hugging Face Transformers loads pretrained checkpoints from the Hub for NLP, vision, audio, and multimodal tasks, runs inference through pipeline() or the Auto* classes, and fine-tunes them with Trainer. This skill targets transformers v5 (≥ 5.0; current 5.17.0 as of 2026-09). v5 is PyTorch-only and changes several v4 idioms, so check "v5 changes that break v4 code" below before reusing older snippets from papers, blogs, or model cards.
When to Use This Skill
Use this skill when the user wants to:
- Run quick inference with a Hub checkpoint via
pipeline()— text classification, NER, zero-shot classification, text generation with a chat model, speech recognition, image classification/detection, or image-text-to-text with a VLM. - Load a model plus tokenizer/processor with explicit
dtype,device_map, attention backend, or 4/8-bit quantization. - Control decoding in
model.generate()(greedy, sampling, beam search, streaming, chat templates). - Fine-tune an encoder or decoder on a custom labelled dataset with
Trainer, optionally with LoRA viapeft. - Port v4-era code (
torch_dtype=,load_in_8bit=, removed pipelines, TF/Flax models) to v5.