Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 38 ยท Getting Started

What Is Hugging Face Transformers?

Meet the Hugging Face ecosystem: the Transformers library, the Hub, Datasets and Tokenizers, and learn what you can build and how this course teaches it.

Hugging Face Transformers is an open-source Python library that gives you one consistent way to download, run, fine-tune and share modern neural networks. Language models, image classifiers, speech recognizers and multimodal models all share the same few entry points: a tokenizer or processor that prepares the input, a model that computes, and a pipeline that glues both together for a one-line demo.

Around the library sits a small ecosystem. The Hub hosts several million model repositories, datasets and demo apps. The datasets library loads and preprocesses data efficiently. The tokenizers library does fast text splitting in Rust. accelerate, peft and evaluate handle multi-GPU training, parameter-efficient fine-tuning and metrics. This course walks through all of them in the order you will meet them in real projects.

Honest note about this site. The real transformers, torch, datasets and Hub downloads cannot run inside your browser here: models are hundreds of megabytes to many gigabytes. So every real library call in this course is shown as a read-only code block. Next to it you get a runnable stand-in written in plain Python (real Pyodide, with NumPy where needed) that implements the idea behind the call, labelled as a stand-in. Output is shown for real library code only when it is certain.

The big picture

The Hugging Face ecosystem

Transformers Models, tokenizers, pipelines, Trainer.
Hub Models, datasets and Spaces.
Datasets Fast loading, map and streaming.
Evaluate Metrics and comparisons.

Each piece works alone, but they fit together.

1 / 2

What a "transformer" model is

A transformer is a neural network built from attention layers. Attention lets every token in a sentence look at every other token and decide how much each one matters for its own meaning. The 2017 paper that introduced it replaced recurrent networks for most language tasks, and the same building block now powers vision, audio and code models. You will build the core idea from scratch in the architecture lesson.

The first look at the code

This is what a complete sentiment classifier looks like with the real library. It is read-only here, because it downloads a model on the first call.

Python
from transformers import pipeline

classifier = pipeline("sentiment-analysis")
result = classifier("I love how simple this library makes things.")
print(result)
# A list with one dictionary: a "label" (POSITIVE or NEGATIVE) and a "score" between 0 and 1.

Three things happen behind these two lines: the library picks a default model for the task and downloads it to a cache; a tokenizer converts the string into integer ids; the model returns raw scores that the pipeline converts into a label and a probability.

A stand-in you can run

The program below is a stand-in, not a neural network. It uses a tiny hand-written word list to mimic the shape of the pipeline: text in, list of dictionaries out. Change the sentences and watch the structure stay the same.

Python Stand-in: a toy sentiment pipeline

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice that a single string returns a list with one item, and a list of strings returns a list of equal length. The real pipelines follow exactly the same convention, which makes it easy to scale from one demo sentence to a thousand records.

What you can build

The library covers many tasks with the same API:

Area Example tasks
Text classification, token classification (NER), question answering, summarization, translation, text generation
Vision image classification, object detection, segmentation, depth estimation
Audio speech recognition, audio classification, text to speech
Multimodal image captioning, visual question answering, document understanding

This course concentrates on text first, then shows how vision and audio use the same pattern. See model families for the full map.

How the course is organised

You will learn getting started, the Hub and tokenizers, pipelines for inference, datasets and preprocessing, then fine-tuning, parameter-efficient training, evaluation and deployment. The order mirrors a real project: explore, prepare, train, measure, ship.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the main purpose of the Hugging Face Hub?

    The Hub is a platform of repositories for models, datasets and Spaces. Training happens wherever you run your own code.
  2. 2. Which library handles fast loading and preprocessing of datasets?

    The datasets library loads data, memory-maps it with Apache Arrow and offers map, filter and streaming.
  3. 3. Why are the real library calls read-only on this site?

    Real models take hundreds of megabytes or more, so the site pairs read-only real code with small runnable stand-ins.
  4. 4. What does a pipeline return for a list of three input strings?

    Pipelines keep one result per input item, so list in gives list out.

Summary

  • Transformers is a library with a uniform API for tokenizers, models and pipelines across text, vision and audio.
  • The ecosystem adds the Hub, datasets, evaluate, peft, accelerate and Spaces.
  • Transformers are built from attention layers, which let every token read every other token.
  • On this site real calls are read-only; labelled stand-ins run in your browser.

Next: Installation and Environment