
Transformers-Tutorials
A collection of Jupyter notebook demos showing how to use Hugging Face Transformers models in PyTorch.
- Stars
- 11.8k
- Forks
- 1.7k
- Licence
- MIT
- Language
- Jupyter Notebook
- Last update
- 2 months ago
- Type
- Learning resource
What it is
This repository is a set of tutorial notebooks by Niels Rogge, a Hugging Face contributor, that demonstrate the Transformers library. Each demo covers a specific model such as BERT, DETR, CLIPSeg, or Donut, showing how to run inference or fine-tune it on a dataset. The README says all demos are implemented in PyTorch and links each notebook to a Google Colab badge for running it without local setup.
- Run an object detection model like DETR on an image using the inference notebook
- Fine-tune BERT for named entity recognition or multi-label text classification
- Try zero-shot image segmentation with CLIPSeg
- Visualize self-attention maps of a DINO vision transformer
- Run Donut for document image classification or document visual question answering
Great for
- Developers learning how to use Hugging Face Transformers models in PyTorch
- Students who want runnable examples for BERT, DETR, or vision transformers
- Engineers who want a starting point for fine-tuning a model on their own dataset
- People looking for document AI examples such as Donut or LayoutLM-style models
Not ideal for
- Complete beginners to Python or machine learning, since the README recommends the Hugging Face course first for background
- People who need a production-ready library or service, since this is a set of demos rather than a maintained package
- Users who need TensorFlow or JAX examples, since the README says the demos are PyTorch
How to get it
- 1
Clone and build from source
You'll need: Python · Jupyter Notebook or Google Colab · PyTorch · Hugging Face Transformers library
Clone the repository
git clone https://github.com/NielsRogge/Transformers-Tutorials - 2
Run it
- Open the README and pick a demo, such as BERT or DETR.
- Click the Open In Colab badge next to the demo to run it in your browser.
- Or clone the repo and open the notebook locally in Jupyter.
- Run the cells in order to see the model output.
- 3
Get the most out of it
- Read the Hugging Face course linked in the README first if you are new to Transformers
- Start with an inference notebook before trying a fine-tuning notebook
- Use the linked Hugging Face vision ecosystem overview notebook for a computer vision orientation
- Adapt the fine-tuning notebooks to your own dataset, as the demos are designed as templates
Downloads
Strengths
- Covers many different model families in one place, from text to vision to audio
- Each demo links to a Colab notebook, so it can be run without local setup
- Written by a Hugging Face contributor and linked to the official course and libraries
Trade-offs
- The README is truncated in the provided text, so the full list of demos and their status is not confirmed here
- Notebooks are tutorials, not a tested library, so code may depend on specific library versions
- The README points to a free course for background, so it assumes some prior familiarity with Transformers
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| Transformers-Tutorials (this) | 11.8k | Learning resource | intermediate | 2 months ago | Developers learning how to use Hugging Face Transformers models in PyTorch |
| annotated_deep_learning_paper_implementations | 67.6k | Learning resource | intermediate | 4 days ago | Students learning how transformers, GANs, or optimizers work internally |
| nlp-tutorial | 14.9k | Learning resource | intermediate | 2.7 years ago | Students who want to see how classic NLP models work in code |
| LoRA | 13.9k | Library | intermediate | 1.9 years ago | Machine learning engineers adapting RoBERTa, DeBERTa or GPT-2 style models in PyTorch |
| Made-With-ML | 49.9k | Learning resource | intermediate | 8 months ago | Software engineers who want to learn how ML models get deployed and maintained |
| pytorch-tutorial | 32.5k | Learning resource | intermediate | 3.2 years ago | Researchers or engineers who already know Python and want to learn PyTorch |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.