Using Transformers Locally

A simple guide to using transformer models on your machine!

Start Learning
Transformers Illustration

Introduction

Welcome to this guide on learning how to use transformer models locally. This guide will walk you through the fundamental concepts, setup, and practical applications of transformers in natural language processing (NLP).

Chapters

Chapter 1: Introduction to Learning Transformers

This chapter introduces the basics of transformer models and provides an overview of their applications in NLP.

Chapter 1

Chapter 2: Text Classification with Transformers

This chapter covers text classification tasks using transformer models, demonstrating various NLP use cases.

Chapter 2

Chapter 3: Example - Detecting Hate Speech in Arabic

This chapter provides a practical example of using transformers to detect hate speech in Arabic text.

Chapter 3

Chapter 4a: Looking into the Black Box (Part 1)

Transformer Models are often seen as black boxes. Here we visualize the attention mask to see the relations a model makes.

Chapter 4a

Chapter 4b: Looking into the Black Box (Part 2)

After visualizing the data in Part 1, we now extract the weights from a GPT model in Part 2, so we can learn how it makes its predictions.

Chapter 4b

Chapter 5: Example - Mamba the Future of NLP?

Here we explore the Mamba model and compare it to an 8B transformer model.

Chapter 5

Chapter 6: Diagnosing Autism by Reading Simulated Doctors' Notes

In this project I develop a pipeline to help doctors diagnose autism by simply reading their notes.

Chapter 6

Chapter 7: Text to Image

Here we use Stable Diffusion to convert text to images. Have a crazy idea? Make it into a picture in seconds!

Chapter 7

Chapter 8: Image to Text and Speech

In this project we convert images to text. Since we turned the image to text, we may as well add TTS as well!

Chapter 8

Resources

Here are some additional resources to help you deepen your understanding of transformer models: