huggingface-transformers
Use Hugging Face Transformers for local model inference, embeddings, and fine-tuning. Covers pipelines, model selection, quantization, and optimization. Use when working with local LLMs, embeddings, or custom model training.
npx skills add majiayu000/claude-skill-registry --skill huggingface-transformers-fgarofalo56-suppercharge-microso --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
It instructs the agent to use Hugging Face Transformers for local model inference, embeddings, and fine-tuning. It covers pipelines, model selection, quantization, and optimization. It explicitly advises when to use it: with local LLMs, embeddings, or custom model training.
How it works
- Uses Pipeline API for tasks: text-generation, text-classification, ner, question-answering, summarization, etc., with corresponding models and configurations. Example commands include: "pipeline("text-generation")" and specific model choices like "microsoft/DialoGPT-medium" or "mistralai/Mistral-7B-Instruct-v0.2".
- Shows installation steps for core transformers, extras, embeddings, quantization, PEFT/LoRA, and datasets via pip install commands.
- Demonstrates loading models and tokenizers with from_pretrained, including options for device placement (device_map), precision (torch_dtype), and offline loading (local_files_only).
- Provides Embeddings with Sentence Transformers usage and examples for encoding and similarity.
- Details Text Generation in advanced modes (chat-style and streaming) with sample code for chat templates and streaming via TextIteratorStreamer.
- Outlines Quantization methods: BitsAndBytes 4-bit/8-bit, GPTQ, and memory comparisons across precisions.
- Describes Fine-Tuning workflows: basic Trainer usage with datasets, training arguments, and evaluation setup; also shows custom metrics and PEFT/LoRA workflows including LoRA configuration, saving/loading adapters, and QLoRA.
- Includes Model Selection workflow from the hub: searching models, obtaining model info, and recommended models by task.
- Provides local inference optimization guidance with a Batch Processing example (truncated in snippet).
When to use it
Use when working with local LLMs, embeddings, or custom model training.
What it can touch
The skill references tools and libraries, notably: "pipeline", "AutoTokenizer", "AutoModel", "AutoModelForCausalLM", "SentenceTransformer", "Trainer", and PEFT components. It prescribes commands like "pip install transformers torch", "from transformers import pipeline" and various from_pretrained, BitsAndBytesConfig, LoraConfig, get_peft_model, PeftModel, prepare_model_for_kbit_training. It also uses the HuggingFace Hub API via "from huggingface_hub import HfApi, list_models".
Caveats
The material lists licenses and dependencies (MIT license for the skill). It shows complex configurations (device_map, torch_dtype, quantization, and PEFT) that require compatible hardware and software versions; potential risk in mixing quantization settings with certain models is implied by the need to specify options like trust_remote_code and attn_implementation, but no explicit warnings beyond shown examples.
# Hugging Face Transformers Skill ## Quick Reference | Task | Approach | Key Class | |------|----------|-----------| | Text Generation | `pipeline("text-generation")` | `AutoModelForCausalLM` | | Classification | `pipeline("text-classification")` | `AutoModelForSequenceClassification` | | Embeddings | `sentence-transformers` | `SentenceTransformer` | | NER | `pipeline("ner")` | `AutoModelForTokenClassification` | | QA | `pipeline("question-answering")` | `AutoModelForQuestionAnswering` | | Fine-tuning | `Trainer` API | `TrainingArguments` | ## Installation ```bash # Core transformers pip install transformers torch # With all extras pip install transformers[torch] accelerate # For embeddings pip install sentence-transformers # For quantization pip install bitsandbytes # For PEFT/LoRA pip install peft # For datasets pip install datasets ``` ## Pipeline API (Fastest Start) ### Text Generation ```python from transformers import pipeline # Simple generation generator = pipeline("text-generation", model="microsoft/DialoGPT-medium") result = generator("Hello, how are you?", max_length=50, num_return_sequences=1) print(result[0]["generated_text"]) # With specific model for instruction foll
- Quick Reference
- Installation
- Pipeline API (Fastest Start)
- Text Generation
- Text Classification
- Named Entity Recognition
- Question Answering
- Summarization
- Model and Tokenizer Loading
- Basic Loading
- Loading with Options
- Offline Loading
- Embeddings with Sentence Transformers
- Basic Embeddings
Core transformers pip install transformers torch With all extras pip install transformers[torch] accelerate For embeddings pip install sentence-transformers For quantization pip install bitsandbytes For PEFT/LoRA pip install peft
What does the huggingface-transformers skill do?
Use Hugging Face Transformers for local model inference, embeddings, and fine-tuning. Covers pipelines, model selection, quantization, and optimization. Use when working with local LLMs, embeddings, or custom model training.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill huggingface-transformers-fgarofalo56-suppercharge-microso --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
