Theory of Intelligence
DEEP LEARNING•Sequences And Transformers•Working With Pretrained Transformers•5.1 Hugging Face Transformers

Introduction

Using thousands of pretrained models in a few lines: pipelines for instant results, tokenizers and model classes for full control, and finding the right model on the Hub.

Introduction

Pretraining a transformer takes huge datasets and a lot of compute. Fortunately, you rarely need to: companies, universities and individuals share pretrained models openly. The Hugging Face ecosystem has become the standard way to find, download and use them:

  • the transformers library: one consistent Python interface to thousands of model architectures (BERT, GPT-2, T5, Llama, ViT, Whisper, CLIP…), built on PyTorch;
  • the Model Hub (huggingface.co): hundreds of thousands of pretrained and fine-tuned models, with documentation ("model cards");
  • companion libraries: datasets (loading and processing datasets), tokenizers (fast tokenization), peft (LoRA and friends, Training tab topic 5.3), accelerate (multi-GPU training) and evaluate.

Think of the Hub as an enormous app store for AI models, and the transformers library as the universal phone that can run any app from it.

Discuss theoretical concepts, mathematical formulas, and architectural foundations.

Supports inline code with `backticks`
No comments yet. Be the first to start the discussion!