/notebooks

Jupyter notebooks for Natural Language Processing with Transformers

Primary LanguageJupyter NotebookApache License 2.0Apache-2.0

Transformers Notebooks

This repository contains the example code from our O'Reilly book Natural Language Processing with Transformers:

book-cover

Getting started

You can run these notebooks on platforms like Google Colab or your local machine. Note that most chapters require a GPU to run in a reasonable amount of time, so we recommend Colab as it comes pre-installed with CUDA.

Nowadays, the GPUs on Colab tend to be K80s (which have limited memory), so alternative platforms we recommend include:

These platforms tend to provide more performant GPUs like P100s, all for free!

Running on Google Colab

To run these notebooks on Colab, just click on the Open In Colab button at the top of each notebook.

Running on your machine

To run the notebooks on your own machine, first clone the repository:

git clone https://github.com/nlp-with-transformers/notebooks
cd notebooks-test

Next, you'll need to install a few packages that depend on your operating system and hardware:

Once you have install the above requirements, create a virtual environment and install the remaining Python dependencies:

conda create -n book python=3.8 -y && conda activate book
from install import *
install_requirements()
# Use the following to run Chapter 7
# install_requirements(is_chapter7)