transformers

Load and run HuggingFace Transformers models for inference and fine-tuning.

15|2|Updated May 23, 2026
One-click install
npx skills add https://github.com/VKirill/antigravity-for-claude-code --skill transformers-vkirill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: transformers
Source: https://github.com/VKirill/antigravity-for-claude-code/tree/main/skills/transformers
Command: npx skills add https://github.com/VKirill/antigravity-for-claude-code --skill transformers-vkirill

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Transformers helps you reliably load HuggingFace pretrained models and run inference or fine-tuning without getting stuck on tokenizer/template mismatches, generation settings, or GPU/quantization configuration.

Core Features & Use Cases

  • Model loading & task routing: Use AutoTokenizer and AutoModelFor* to load the correct architecture from a single checkpoint string.
  • Inference & generation: Use pipeline() or model.generate() with correct max_new_tokens, EOS/PAD handling, and optional streaming via TextIteratorStreamer.
  • Training & adaptation: Fine-tune with Trainer/TrainingArguments, including PEFT LoRA/QLoRA and bitsandbytes quantization for memory-efficient runs.
  • Data & multimodal support: Tokenize datasets with datasets.load_dataset + .map(), and handle vision/audio with AutoProcessor and appropriate multimodal pipelines.

Quick Start

Use this skill to fine-tune and generate with a consistent HF stack by running the Transformers flow for the task and checkpoint you need.

Frequently Asked Questions about transformers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I load and run a HuggingFace Transformers model for inference?

To load and run HuggingFace Transformers models, use AutoTokenizer and AutoModelFor* with pipeline() for quick inference, or model.generate() for controlled decoding. Ensure correct checkpoint-aligned tokenizer and model pairing to avoid template mismatches.

What is the best way to fine-tune a HuggingFace model with LoRA and quantization?

Fine-tuning HuggingFace models with LoRA and quantization uses Trainer and TrainingArguments with PEFT LoRA/QLoRA alongside bitsandbytes. This enables memory-efficient adaptation while configuring device_map, dtype, and attention settings correctly.

How do I tokenize datasets safely for HuggingFace model training?

Tokenize datasets safely for HuggingFace training by loading data with datasets.load_dataset and applying preprocessing via datasets.map using the processing_class. Follow batching padding_side rules to ensure correct input formatting for the model.

Does HuggingFace Transformers support vision and audio multimodal tasks?

HuggingFace Transformers supports vision and audio multimodal tasks by using AutoProcessor and appropriate multimodal pipelines. It routes text, vision, and audio inputs through the correct architecture loaded from a single checkpoint string.

Why does my HuggingFace text generation output repeat or stop prematurely?

HuggingFace text generation issues like repetition or premature stopping often stem from incorrect EOS and PAD token handling in model.generate(). Configure max_new_tokens carefully and ensure tokenizer generation settings align with the model checkpoint.