Resources

Transformers and Hub APIs move quickly—prefer the official docs. This page lists primary documentation, related courses on this site, and an optional path for coding agents.


Official

Skills let Cursor, Claude Code, and similar tools follow SKILL.md for Hub / training jobs. That is not the main path of this tutorial.


Docs you will reopen

TopicWhere (concept)
First tourQuicktour / Pipeline
Load tipsfrom_pretrained, device_map="auto", dtype="auto"
Generationgenerate(), GenerationConfig, max_new_tokens
TrainingTrainer, TrainingArguments
Three objectsPreTrainedConfig, PreTrainedModel, Preprocessor

CourseLinkWhen to open it
PyTorch/en/pytorch/Tensors, nn.Module, handwritten training loops
Ollama/en/ollama/Easier local chat without owning generate()
LangChain/en/langchain/Tools, agents, RAG (example 2 is intentionally retrieval-free)

A useful order: PyTorch for foundations → Transformers to load and fine-tune Hub models → Ollama for everyday chat.


Tutorial index

  1. Hugging Face tutorial
  2. Introduction
  3. Installation
  4. Quick Start
  5. Pipeline
  6. Tokenizers and Models
  7. Text Generation
  8. Datasets
  9. Fine-tuning
  10. The Hub
  11. Practical Examples

Suggested exercises

  1. Classify 10 reviews you wrote; note the score distribution
  2. Compare DistilGPT2 greedy vs temperature=0.9 continuations
  3. Run Trainer.train() on a 500-row rotten_tomatoes slice
  4. (GPU) Attach LoRA to Qwen 0.5B and print_trainable_parameters()
  5. push_to_hub a local folder and add one paragraph to the model card

Contribute

This tutorial lives in Kenhuang Academy. When APIs change, open an issue or PR and update both docs/zh/huggingface/ and docs/en/huggingface/.

For loading, follow the official tips: prefer device_map="auto" and dtype="auto".

评论